So I'm trying to download slycot via pip and I keep getting errors. To be completely honest I'm not totally familiar with terminal prompts and how all that works. Here is what I'm getting when I run, sudo -H pip3 install slycot
Here is what terminal publishes with that command:
Collecting slycot
Using cached https://files.pythonhosted.org/packages/ae/9d/7ed3f2abf08aab0be9ac2b67e3040c20d9c594cce6a4af2203da0c28a6c4/slycot-0.3.5.0.tar.gz
Installing build dependencies ... done
Missing build requirements in pyproject.toml for slycot from https://files.pythonhosted.org/packages/ae/9d/7ed3f2abf08aab0be9ac2b67e3040c20d9c594cce6a4af2203da0c28a6c4/slycot-0.3.5.0.tar.gz#sha256=cad98d5ea4f0a034cf398c39189f587620a0b03f1d4b71e77cd622a327f13adf.
The project does not specify a build backend, and pip cannot fall back to setuptools without 'setuptools>=40.8.0' and 'wheel'.
Getting requirements to build wheel ... error
Complete output from command /Library/Developer/CommandLineTools/usr/bin/python3 /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpz94vocr1:
Traceback (most recent call last):
File "setup.py", line 25, in <module>
from skbuild import setup
ModuleNotFoundError: No module named 'skbuild'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 207, in <module>
main()
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 197, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 54, in get_requires_for_build_wheel
return hook(config_settings)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/build_meta.py", line 130, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/build_meta.py", line 112, in _get_build_requires
self.run_setup()
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/build_meta.py", line 211, in run_setup
self).run_setup(setup_script=setup_script)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/build_meta.py", line 126, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 28, in <module>
raise ImportError('sckit-build must be installed before running setup.py')
ImportError: sckit-build must be installed before running setup.py
----------------------------------------
Command "/Library/Developer/CommandLineTools/usr/bin/python3 /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpz94vocr1" failed with error code 1 in /private/tmp/pip-install-t9m8s8yp/slycot
You are using pip version 19.0.3, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
I've now tried pip install scikit-build and this returns
Requirement already satisfied: scikit-build in /Library/Python/3.7/site-packages (0.10.0)
Requirement already satisfied: packaging in /Library/Python/3.7/site-packages (from scikit-build) (20.1)
Requirement already satisfied: setuptools>=28.0.0 in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages (from scikit-build) (40.8.0)
Requirement already satisfied: wheel>=0.29.0 in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages (from scikit-build) (0.33.1)
Requirement already satisfied: pyparsing>=2.0.2 in /Library/Python/3.7/site-packages (from packaging->scikit-build) (2.4.6)
Requirement already satisfied: six in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages (from packaging->scikit-build) (1.12.0)
You are using pip version 19.0.3, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
I've also tried, pip install cmake and this returns
Requirement already satisfied: cmake in /Library/Python/3.7/site-packages (3.16.3)
You are using pip version 19.0.3, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Any help would be appreciated.
You have another error with the installation of slycot, you have a dependency on skbuild.
In order to fix it check this site that gives you the compiled binaries to the skbuild package and try again [and maybe cmake as well]
Try this
pip install scikit-build; pip install cmake
You can read here for more details and ways to make this work.
Not able to install skbuild
Related
What is the real world proven working method to conda switch to a Python 2.7 environment and install mechanize using pip?
Here's a new brand new stock Anaconda install which I just tested and get:
C:\Program Files\Anaconda3\Scripts>activate py27
(py27) C:\Program Files\Anaconda3\Scripts>pip install mechanize
Collecting mechanize
Downloading mechanize-0.3.6.tar.gz (201kB)
100% |████████████████████████████████| 204kB 1.7MB/s
Complete output from command python setup.py egg_info:
mechanize only works on python 2.x
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Temp\pip-build-cmll3
thk\mechanize\
(py27) C:\Program Files\Anaconda3\Scripts>pip install --upgrade setuptools
Collecting setuptools
Downloading setuptools-36.6.0-py2.py3-none-any.whl (481kB)
100% |████████████████████████████████| 481kB 428kB/s
Installing collected packages: setuptools
Found existing installation: setuptools 27.2.0
Uninstalling setuptools-27.2.0:
Successfully uninstalled setuptools-27.2.0
Successfully installed setuptools-36.6.0
Traceback (most recent call last):
File "C:\Program Files\Anaconda3\Scripts\pip-script.py", line 5, in <module>
sys.exit(pip.main())
File "C:\Program Files\Anaconda3\lib\site-packages\pip\__init__.py", line 249, in ma
in
return command.main(cmd_args)
File "C:\Program Files\Anaconda3\lib\site-packages\pip\basecommand.py", line 252, in
main
pip_version_check(session)
File "C:\Program Files\Anaconda3\lib\site-packages\pip\utils\outdated.py", line 102,
in pip_version_check
installed_version = get_installed_version("pip")
File "C:\Program Files\Anaconda3\lib\site-packages\pip\utils\__init__.py", line 838,
in get_installed_version
working_set = pkg_resources.WorkingSet()
File "C:\Program Files\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init_
_.py", line 644, in __init__
self.add_entry(entry)
File "C:\Program Files\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init_
_.py", line 700, in add_entry
for dist in find_distributions(entry, True):
File "C:\Program Files\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init_
_.py", line 1949, in find_eggs_in_zip
if metadata.has_metadata('PKG-INFO'):
File "C:\Program Files\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init_
_.py", line 1463, in has_metadata
return self.egg_info and self._has(self._fn(self.egg_info, name))
File "C:\Program Files\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init_
_.py", line 1823, in _has
return zip_path in self.zipinfo or zip_path in self._index()
File "C:\Program Files\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init_
_.py", line 1703, in zipinfo
return self._zip_manifests.load(self.loader.archive)
File "C:\Program Files\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init_
_.py", line 1643, in load
mtime = os.stat(path).st_mtime
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'C:\\Progra
m Files\\Anaconda3\\lib\\site-packages\\setuptools-27.2.0-py3.6.egg'
(py27) C:\Program Files\Anaconda3\Scripts>pip install ez_setup
Collecting ez_setup
Downloading ez_setup-0.9.tar.gz
Building wheels for collected packages: ez-setup
Running setup.py bdist_wheel for ez-setup ... done
Stored in directory: C:\Users\Admin1\AppData\Local\pip\Cache\wheels\53\d6\8b\a2270e6
6cf5f68c038fffcc8b871de0c4326550fb187906bab
Successfully built ez-setup
Installing collected packages: ez-setup
Successfully installed ez-setup-0.9
(py27) C:\Program Files\Anaconda3\Scripts>pip install --upgrade setuptools
Requirement already up-to-date: setuptools in c:\program files\anaconda3\lib\site-pack
ages
(py27) C:\Program Files\Anaconda3\Scripts>pip install --upgrade setuptools --force
Collecting setuptools
Using cached setuptools-36.6.0-py2.py3-none-any.whl
Installing collected packages: setuptools
Found existing installation: setuptools 36.6.0
Uninstalling setuptools-36.6.0:
Successfully uninstalled setuptools-36.6.0
Successfully installed setuptools-36.6.0
(py27) C:\Program Files\Anaconda3\Scripts>pip install mechanize
Collecting mechanize
Using cached mechanize-0.3.6.tar.gz
Complete output from command python setup.py egg_info:
mechanize only works on python 2.x
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Temp\pip-build-qo4zx
99o\mechanize\
(py27) C:\Program Files\Anaconda3\Scripts>easy_install -U setuptools
Searching for setuptools
Reading https://pypi.python.org/simple/setuptools/
Downloading https://pypi.python.org/packages/45/29/8814bf414e7cd1031e1a3c8a4169218376e
284ea2553cc0822a6ea1c2d78/setuptools-36.6.0.zip#md5=74663b15117d9a2cc5295d76011e6fd1
Best match: setuptools 36.6.0
Processing setuptools-36.6.0.zip
Writing C:\Temp\easy_install-wyi8iiw7\setuptools-36.6.0\setup.cfg
Running setuptools-36.6.0\setup.py -q bdist_egg --dist-dir C:\Temp\easy_install-wyi8ii
w7\setuptools-36.6.0\egg-dist-tmp-eq7ol_dl
warning: no files found matching '*' under directory 'setuptools\_vendor'
Copying setuptools-36.6.0-py3.6.egg to c:\program files\anaconda3\lib\site-packages
Adding setuptools 36.6.0 to easy-install.pth file
Installing easy_install-script.py script to c:\program files\anaconda3\Scripts
Installing easy_install.exe script to c:\program files\anaconda3\Scripts
error: [WinError 5] Access is denied: 'c:\\program files\\anaconda3\\Scripts\\easy_ins
tall.exe'
(py27) C:\Program Files\Anaconda3\Scripts>pip install mechanize
Collecting mechanize
Using cached mechanize-0.3.6.tar.gz
Complete output from command python setup.py egg_info:
mechanize only works on python 2.x
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Temp\pip-build-ui1ll
y8p\mechanize\
(py27) C:\Program Files\Anaconda3\Scripts>pip install --upgrade setuptools --force
(py27) C:\Program Files\Anaconda3\Scripts>
(py27) C:\Program Files\Anaconda3\Scripts>
(py27) C:\Program Files\Anaconda3\Scripts>
(py27) C:\Program Files\Anaconda3\Scripts>python -m pip install --upgrade pip
Requirement already up-to-date: pip in c:\program files\anaconda3\envs\py27\lib\site-p
ackages
(py27) C:\Program Files\Anaconda3\Scripts>pip install mechanize --force
Collecting mechanize
Using cached mechanize-0.3.6.tar.gz
Complete output from command python setup.py egg_info:
mechanize only works on python 2.x
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Temp\pip-build-rsxl3
v5_\mechanize\
The main advantage of anaconda is that they've taken the time to compile packages (not just Python ones) and ensure they're compatible with each other, so that everything should "just work' for the user. This is especially useful on Windows, where compiling some Python packages may be difficult (and not everything has a wheel available on PyPI).
Such packages are available to install via conda install <foo>. Whilst you can still use pip install <foo> (and indeed will need to do so for any packages not available through anaconda's package manager), you should use the conda install where packages are available - otherwise you're not getting the benefit that anaconda intends to provide.
So (as per anaconda's docs for mechanize) you want:
conda install -c conda-forge mechanize
(You explicitly requested no attempts to convince you to use a different approach - I'm taking that to mean that you want to use anaconda and python27, rather than to definitely use pip. Obviously this is no help if pip is a must for you! I believe the "real world solution" that you're after is to use conda install rather than pip install wherever possible when using anaconda - see the answers to this question for an explanation of the differences between pip and conda)
I've browsed around but couldn't find anyone else getting this error. I'm trying to make a TwitterBot but I am unable to install tweepy with the following command:
pip install tweepy
I've tried using sudo/su and a few other methods but this exception always pops up:
pip install tweepy
Collecting tweepy
Downloading tweepy-3.5.0-py2.py3-none-any.whl
Requirement already satisfied: requests>=2.4.3 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from tweepy)
Requirement already satisfied: requests-oauthlib>=0.4.1 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from tweepy)
Collecting six>=1.7.3 (from tweepy)
Downloading six-1.10.0-py2.py3-none-any.whl
Requirement already satisfied: oauthlib>=0.6.2 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from requests-oauthlib>=0.4.1->tweepy)
Installing collected packages: six, tweepy
Found existing installation: six 1.4.1
DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling six-1.4.1:
Exception:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/req/req_set.py", line 778, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/req/req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
copy2(src, real_dst)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
copystat(src, dst)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/tmp/pip-ACL5B3-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'
I think that your problem is linked to six package.
Try to install tweepy running this command:
sudo pip install tweepy --ignore-installed six
or
pip install --ignore-installed six
You can find the six issue here.
Let me know.
The exception is for non root users.
Try,
sudo pip install tweepy
Its scikit-image Download says:
pip install -U scikit-image
or
easy_install -U scikit-image
but both fail, regardless of the flag U, as shown below:
Georgioss-MacBook-Pro:Downloads gsamaras$ sudo pip install scikit-image
The directory '/Users/gsamaras/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/gsamaras/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting scikit-image
Downloading scikit_image-0.12.3-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (22.2MB)
100% |████████████████████████████████| 22.2MB 53kB/s
Requirement already satisfied: dask[array]>=0.5.0 in /Library/Python/2.7/site-packages (from scikit-image)
Collecting six>=1.7.3 (from scikit-image)
Downloading six-1.10.0-py2.py3-none-any.whl
Collecting networkx>=1.8 (from scikit-image)
Downloading networkx-1.11-py2.py3-none-any.whl (1.3MB)
100% |████████████████████████████████| 1.3MB 133kB/s
Requirement already satisfied: pillow>=2.1.0 in /Library/Python/2.7/site-packages (from scikit-image)
Requirement already satisfied: numpy; extra == "array" in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from dask[array]>=0.5.0->scikit-image)
Requirement already satisfied: toolz>=0.7.2; extra == "array" in /Library/Python/2.7/site-packages (from dask[array]>=0.5.0->scikit-image)
Collecting decorator>=3.4.0 (from networkx>=1.8->scikit-image)
Downloading decorator-4.0.10-py2.py3-none-any.whl
Installing collected packages: six, decorator, networkx, scikit-image
Found existing installation: six 1.4.1
DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling six-1.4.1:
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 778, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
copy2(src, real_dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
copystat(src, dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/tmp/pip-qlMJKP-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'
Georgioss-MacBook-Pro:Downloads gsamaras$
and:
Georgioss-MacBook-Pro:Downloads gsamaras$ sudo easy_install scikit-image
Searching for scikit-image
Reading https://pypi.python.org/simple/scikit-image/
Best match: scikit-image 0.12.3
Downloading https://pypi.python.org/packages/86/d0/b0192dc9a544da90f2d9150bcd84b981c6873e42a1f752b6affb89180ad8/scikit-image-0.12.3.tar.gz#md5=04ea833383e0b6ad5f65da21292c25e1
Processing scikit-image-0.12.3.tar.gz
Writing /tmp/easy_install-X6Pjoh/scikit-image-0.12.3/setup.cfg
Running scikit-image-0.12.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-X6Pjoh/scikit-image-0.12.3/egg-dist-tmp-lHJxkL
Killed: 9
Notice that brew also fails, it cannot find it.
I have Python 2.7.10, Matplotlib 1.3.1, PIL 3.4.2 and Scipy '0.18.1'. What to do?
It's generally a bad idea to install libraries on your system-wide Python. Use a virtualenv for each project instead.
First install virtualenv globally on your Mac:
$ [sudo] pip install virtualenv
Then use virtualenv command to create a new (a copy) of Python executable:
$ cd your/prefred/folder
$ virtualenv your_project
Activate the virtualenv:
$ source your_project/bin/activate
Your virtualenv is created and activated (the prompt is changed to show the activation). You can install anything in it:
$ pip install -U scikit-image
pip install scikit-image
pip install --upgrade scikit-image
to call use skimage
(Entering this as an answer so as to include the error message).
Using the first answer from #Krackle I got the following (confusing) output which I am adding here to help others:
pip install skimage
Collecting skimage
Using cached skimage-0.0.tar.gz (757 bytes)
ERROR: Command errored out with exit status 1:
command: /opt/anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/ft/7j605bsd10l0ftqygyxjjflh0000gq/T/pip-install-xtxr1328/skimage/setup.py'"'"'; __file__='"'"'/private/var/folders/ft/7j605bsd10l0ftqygyxjjflh0000gq/T/pip-install-xtxr1328/skimage/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/ft/7j605bsd10l0ftqygyxjjflh0000gq/T/pip-pip-egg-info-q8dwl8rl
cwd: /private/var/folders/ft/7j605bsd10l0ftqygyxjjflh0000gq/T/pip-install-xtxr1328/skimage/
Complete output (3 lines):
*** Please install the `scikit-image` package (instead of `skimage`) ***
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I then used #Krackle's second command which (so far) has solved the problem.
I've got a Mac which has python installed and virtualenvwrapper installed. I'm trying to create a new environment by running:
mkvirtualenv Test
To which I get the following error:
New python executable in /Users/sidharthnayyar/.virtualenvs/Test/bin/python
Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/Library/Python/2.7/site-packages/virtualenvwrapper/hook_loader.py", line 16, in <module>
from stevedore import ExtensionManager
ImportError: No module named stevedore
I have python installed here:
$ which -a python
/usr/local/bin/python
/usr/bin/python
If I try sudo pip install stevedore then it says its already installed with some warnings:
sudo /usr/local/bin/pip install stevedore
The directory '/Users/sidharthnayyar/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/sidharthnayyar/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied (use --upgrade to upgrade): stevedore in ./Library/Python/2.7/lib/python/site-packages
Requirement already satisfied (use --upgrade to upgrade): pbr>=1.6 in /Library/Python/2.7/site-packages (from stevedore)
Requirement already satisfied (use --upgrade to upgrade): six>=1.9.0 in ./Library/Python/2.7/lib/python/site-packages (from stevedore)
If I try sudo -H pip install stevedore then I get the following errors:
sudo -H /usr/local/bin/pip install stevedore
Collecting stevedore
Using cached stevedore-1.18.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): pbr>=1.6 in /Library/Python/2.7/site-packages (from stevedore)
Collecting six>=1.9.0 (from stevedore)
Using cached six-1.10.0-py2.py3-none-any.whl
Installing collected packages: six, stevedore
Found existing installation: six 1.4.1
DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling six-1.4.1:
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 736, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 742, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
copy2(src, real_dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
copystat(src, dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/tmp/pip-NOex2K-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'
If I create a .bash_profile and put into it:
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
source /usr/local/bin/virtualenvwrapper.sh
and reload a terminal window then I get the following error:
source ~/.bash_profile
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/Library/Python/2.7/site-packages/virtualenvwrapper/hook_loader.py", line 16, in <module>
from stevedore import ExtensionManager
ImportError: No module named stevedore
virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python and that PATH is
set properly.
Curious and curiouser.
Any suggestions on what's going wrong and how to fix this?
Thanks
Sidharth
I was very confused with this problem, too. And I have solved it by uninstalling the old stevedore and reinstall it.
sudo pip uninstall stevedore
sudo pip install stevedore
Looks like you managed to install virtualwrapper without stevedore, which is a dependency. Try installing it.
pip install stevedore
with python 2.7 sudo pip install stevedore
I am new to python and is using pip to download and install packages. I ran the following code on my command window and it throws an error
pip install matplotlib
And the process starts as
Collecting matplotlib
Using cached matplotlib-1.5.3-cp27-cp27m-win32.whl
Collecting numpy>=1.6 (from matplotlib)
Using cached numpy-1.11.2-cp27-none-win32.whl
Collecting python-dateutil (from matplotlib)
Using cached python_dateutil-2.5.3-py2.py3-none-any.whl
Collecting cycler (from matplotlib)
Using cached cycler-0.10.0-py2.py3-none-any.whl
Collecting pyparsing!=2.0.4,!=2.1.2,>=1.5.6 (from matplotlib)
Using cached pyparsing-2.1.10-py2.py3-none-any.whl
Collecting pytz (from matplotlib)
Using cached pytz-2016.7-py2.py3-none-any.whl
Collecting six>=1.5 (from python-dateutil->matplotlib)
Using cached six-1.10.0-py2.py3-none-any.whl
Installing collected packages: numpy, six, python-dateutil, cycler, pyparsing, pytz, matplotlib
Exception:
Traceback (most recent call last):
File "c:\python27\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "c:\python27\lib\site-packages\pip\commands\install.py", line 317, in run
prefix=options.prefix_path,
File "c:\python27\lib\site-packages\pip\req\req_set.py", line 742, in install
**kwargs
File "c:\python27\lib\site-packages\pip\req\req_install.py", line 831, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "c:\python27\lib\site-packages\pip\req\req_install.py", line 1032, in move_wheel_files
isolated=self.isolated,
File "c:\python27\lib\site-packages\pip\wheel.py", line 346, in move_wheel_files
clobber(source, lib_dir, True)
File "c:\python27\lib\site-packages\pip\wheel.py", line 324, in clobber
shutil.copyfile(srcfile, destfile)
File "c:\python27\lib\shutil.py", line 83, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: 'c:\\python27\\Lib\\site-packages\\numpy\\core\\multiarray.pyd'
And it gives these traceback errors. I'm unable to figure out what these errors are and how to solve them. Please help. It works perfectly till collecting the packages but at the time of installing it throws errors.
If you're using Windows, the easiest way to install many of the numerically-oriented Python packages is to download one of wheels containing pre-compiled binaries from http://www.lfd.uci.edu/~gohlke/pythonlibs/, and install using pip:
pip install SomePackage-1.0-py2.py3-none-any.whl
Make sure to download the right wheel version (Python2 or Python3, 32 bit or 64 bit) for your Python installation.
Try python -m pip install matplotlib.
or
Open the cmd as administrator
then python -m pip install matplotlib