Installing python package failed with error.
I want to install 'tsfresh' package in Notebook VM. But it failed with error from both jupyter terminal and jupyter notebook cell.
from Notebook jupyter notebook cell
!pip install --upgrade tsfresh
error message
Exception:
Traceback (most recent call last):
File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/pip/wheel.py", line 329, in clobber
os.utime(destfile, (st.st_atime, st.st_mtime))
PermissionError: [Errno 1] Operation not permitted
You are using pip version 9.0.1, however version 19.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
In my case following resolved the issue you described:
!pip install --upgrade pip
!pip install --upgrade tsfresh
Related
In windows 10, I am running the terminal as an administrator,
It is giving an exception error.
I am trying to upgrade pip but it is giving an error:
python -m pip install --upgrade pip
Collecting pip
Using cached https://files.pythonhosted.org/packages/43/84/23ed6a1796480a6f1a2d38f2802901d078266bda38388954d01d3f2e821d/pip-20.1.1-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 19.3.1
Uninstalling pip-19.3.1:
Successfully uninstalled pip-19.3.1
Rolling back uninstall of pip
Moving to c:\users\user1\appdata\roaming\python\python38\scripts\
from C:\Users\user1\AppData\Roaming\Python\Python38\~cripts
Moving to c:\users\user1\appdata\roaming\python\python38\site-packages\pip-19.3.1.dist-info\
from C:\Users\user1\AppData\Roaming\Python\Python38\site-packages\~ip-19.3.1.dist-info
Moving to c:\users\user1\appdata\roaming\python\python38\site-packages\pip\
from C:\Users\user1\AppData\Roaming\Python\Python38\site-packages\~ip
ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\user1\AppData\Roaming\Python\Python38\site-packages\pip\_internal\cli\base_command.py", line 153, in _main
status = self.run(options, args)
File "C:\Users\user1\AppData\Roaming\Python\Python38\site-packages\pip\_internal\commands\install.py", line 446, in run
installed = install_given_reqs(
File "C:\Users\user1\AppData\Roaming\Python\Python38\site-packages\pip\_internal\req\__init__.py", line 58, in install_given_reqs
requirement.install(
File "C:\Users\user1\AppData\Roaming\Python\Python38\site-packages\pip\_internal\req\req_install.py", line 858, in install
self.move_wheel_files(
File "C:\Users\user1\AppData\Roaming\Python\Python38\site-packages\pip\_internal\req\req_install.py", line 487, in move_wheel_files
wheel.move_wheel_files(
File "C:\Users\user1\AppData\Roaming\Python\Python38\site-packages\pip\_internal\wheel.py", line 594, in move_wheel_files
generated_console_scripts = maker.make_multiple(scripts_to_generate)
File "C:\Users\user1\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\distlib\scripts.py", line 402, in make_multiple
filenames.extend(self.make(specification, options))
File "C:\Users\user1\AppData\Roaming\Python\Python38\site-packages\pip\_internal\wheel.py", line 330, in make
return super(PipScriptMaker, self).make(specification, options)
File "C:\Users\user1\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\distlib\scripts.py", line 391, in make
self._make_script(entry, filenames, options=options)
File "C:\Users\user1\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\distlib\scripts.py", line 295, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "C:\Users\user1\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\distlib\scripts.py", line 231, in _write_script
launcher = self._get_launcher('t')
File "C:\Users\user1\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\distlib\scripts.py", line 370, in _get_launcher
result = finder(distlib_package).find(name).bytes
AttributeError: 'NoneType' object has no attribute 'bytes'
WARNING: You are using pip version 19.3.1; however, version 20.1.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
What should I do to upgrade pip?
Thanks
Try this :
easy_install -U pip
If the above command doesn't work, try the following :
python -m pip install -U --force-reinstall pip
pip told me, that i should update.
After i started the command
pip install --upgrade pip
when i use
pip3 --version
i get the following error:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 635, in _build_master
ws.require(__requires__)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 943, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 834, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (pip 8.1.1 (/usr/lib/python3/dist-packages), Requirement.parse('pip==10.0.1'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/pip3", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2927, in <module>
#_call_aside
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2913, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2940, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 637, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 650, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 829, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==10.0.1' distribution was not found and is required by the application
I tried to install pip again:
sudo apt install python3-pip
but it tells me
python3-pip is already the newest version (8.1.1-2ubuntu0.4).
How can i fix this problem?
Thanks.
Try to reinstall it.
apt install --reinstall python3-pip
Since there is still no real answer...
I also had this problem on Linux (CentOS 7) and managed to fix it.
Go to home folder.
$ cd ~
If you need the most recent version:
$ pip3 install --user --upgrade pip
If you need a specific version(like in the question)
$ pip3 install --user pip==10.0.1
I'm new to both python and linux. I have python 3.4 on a Uberstudent linux distribution(based on Ubuntu 14.04).
I'm trying to get a progress bar for scripts in python. So I run
pip install progressbar
in the command line. Then I get the error
Command python setup.py egg_info failed with error code 1
After searching for a while I find that this is because pip, setuptools and wheel are not up to date. So I run
python3 -m pip install --upgrade pip setuptools wheel
and I get the output
Downloading/unpacking pip from https://pypi.python.org/packages/b6/ac/7015eb97dc749283ffdec1c3a88ddb8ae03b8fad0f0e611408f196358da3/pip-9.0.1-py2.py3-none-any.whl#md5=297dbd16ef53bcef0447d245815f5144
Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB): 1.3MB downloaded
Downloading/unpacking setuptools from https://pypi.python.org/packages/43/41/033a273f9a25cb63050a390ee8397acbc7eae2159195d85f06f17e7be45a/setuptools-38.5.1-py2.py3-none-any.whl#md5=908b8b5e50bf429e520b2b5fa1b350e5
Downloading setuptools-38.5.1-py2.py3-none-any.whl (489kB): 489kB downloaded
Requirement already up-to-date: wheel in /usr/local/lib/python3.4/dist-packages
Installing collected packages: pip, setuptools
Found existing installation: pip 1.5.4
Not uninstalling pip at /usr/lib/python3/dist-packages, owned by OS
Can't roll back pip; was not uninstalled
Cleaning up...
Exception:
Traceback (most recent call last):
File "/usr/lib/python3.4/shutil.py", line 523, in move
os.rename(src, real_dst)
PermissionError: [Errno 13] Permission denied: '/tmp/pip_build_martin/pip/pip-9.0.1.dist-info/WHEEL' -> '/usr/local/lib/python3.4/dist-packages/pip-9.0.1.dist-info/WHEEL'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/lib/python3/dist-packages/pip/req.py", line 1436, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/usr/lib/python3/dist-packages/pip/req.py", line 672, in install
self.move_wheel_files(self.source_dir, root=root)
File "/usr/lib/python3/dist-packages/pip/req.py", line 902, in move_wheel_files
pycompile=self.pycompile,
File "/usr/lib/python3/dist-packages/pip/wheel.py", line 206, in move_wheel_files
clobber(source, lib_dir, True)
File "/usr/lib/python3/dist-packages/pip/wheel.py", line 200, in clobber
shutil.move(srcfile, destfile)
File "/usr/lib/python3.4/shutil.py", line 535, in move
copy2(src, real_dst)
File "/usr/lib/python3.4/shutil.py", line 245, in copy2
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/usr/lib/python3.4/shutil.py", line 109, in copyfile
with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.4/dist-packages/pip-9.0.1.dist-info/WHEEL'
Storing debug log for failure in /home/martin/.pip/pip.log
After some further digging I find that i should try to uninstall it and install it again. But this gives the same permission denied error. And using get-pip.py also gives the same error.
I have no idea what any of this means or why I don't have permission to upgrade pip.
please help me
Try using virtualenv, maybe already installed, so skip the first 2 lines :
$ sudo apt update
$ sudo apt-get install python-virtualenv
$ mkdir test_virtualenv
$ cd test_virtualenv
$ virtualenv .
$ bin/pip install foobar
I tried to install BeautifulSoup 4
It worked after I typed following into my mac terminal
$ easy_install beautifulsoup4
$ pip install beautifulsoup4
But when I imported it in my python,
from bs4 import BeautifulSoup
the screen always shows the Error:
ImportError: cannot import name 'HTMLParseError'
Then I googled the error and found by typing following code in terminal could solve the problem
pip install --upgrade beautifulsoup4
But after I typed,it was shown
Exception:
Traceback (most recent call last):
File "//anaconda/lib/python3.5/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "//anaconda/lib/python3.5/site-packages/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "//anaconda/lib/python3.5/site-packages/pip/req/req_set.py", line 742, in install
**kwargs
File "//anaconda/lib/python3.5/site-packages/pip/req/req_install.py", line 831, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "//anaconda/lib/python3.5/site-packages/pip/req/req_install.py", line 1032, in move_wheel_files
isolated=self.isolated,
File "//anaconda/lib/python3.5/site-packages/pip/wheel.py", line 346, in move_wheel_files
clobber(source, lib_dir, True)
File "//anaconda/lib/python3.5/site-packages/pip/wheel.py", line 324, in clobber
shutil.copyfile(srcfile, destfile)
File "//anaconda/lib/python3.5/shutil.py", line 115, in copyfile
with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: '//anaconda/lib/python3.5/site-packages/bs4/__init__.py'
I have no idea how to fix it. Thanks for someone help
Easiest way to solve this is using Sudo.
sudo pip install --upgrade beautifulsoup4
However sudo is not always recommended to do so, you should not install arbitrary code as root.
My recommendation would be to create a virtualenv, install the packages play with before using sudo to install them as root.
You can use virtualenvwrapper
sudo pip install virtualenvwrapper
mkvirtualenv
workon
python setup.py install
I'm getting the following error when trying to set up a new virtualenv with python3.4 (I'm running this command: virtualenv –p /usr/bin/python /tmp/djangodev):
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site- packages/pkg_resources.py", line 2697, in <module>
working_set.require(__requires__)
File "/System/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 669, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 576, in resolve
raise VersionConflict(dist,req) # XXX put more info here
pkg_resources.VersionConflict: (virtualenv 1.11.6 (/System/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages),
Requirement.parse('virtualenv==1.7.2'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 5, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 2701, in <module>
parse_requirements(__requires__), Environment()
File "/System/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 572, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: virtualenv==1.7.2
I first downloaded virtualenv1.7.2 and after getting this error updated it by running: pip install virtualenv. Here is the successful installation message from this:
Downloading/unpacking virtualenv
Downloading virtualenv-1.11.6-py2.py3-none-any.whl (1.6MB): 1.6MB downloaded
Installing collected packages: virtualenv
Successfully installed virtualenv
Cleaning up...
Can someone please help me resolve the above error?
Thanks #MattDMo for cluing me in.
I indeed have multiple virtualenvs installed so I ran sudo pip uninstall virtualenv and then sudo pip install virtualenv and this resolved the above error.