I am a new to Linux and have dual booted my system. I specifically want to install numpy, darknet or lightnet python packages. I tried following the instructions given here
When I run the below command:
pip install darknetpy
I am seeing the following error:
Collecting darknetpy
Using cached darknetpy-2.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-5J0HcA/darknetpy/setup.py", line 6, in <module>
import urllib.request
ImportError: No module named request
I am unable to understand what this error is about. When I tried installing numpy package, I get the below error:
Exception:
Traceback (most recent call last):
File "/home/test/.local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/test/.local/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/home/test/.local/lib/python2.7/site-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/home/test/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/home/test/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/home/test/.local/lib/python2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/home/test/.local/lib/python2.7/site-packages/pip/wheel.py", line 316, in clobber
ensure_dir(destdir)
File "/home/test/.local/lib/python2.7/site-packages/pip/utils/__init__.py", line 83, in ensure_dir
os.makedirs(path)
File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/numpy-1.13.3.dist-info'
Kindly help in solving this error.
OSError: [Errno 13] Permission denied Typically means you the invoker have insufficient permissions.
It looks like you are trying to pip install it using python2, as eyllanesc pointed out the package you're installing is only supported by python3, so you will have to install it first.
Here are some links to help with that:
http://ubuntuhandbook.org/index.php/2017/07/install-python-3-6-1-in-ubuntu-16-04-lts/
http://docs.python-guide.org/en/latest/starting/install3/linux/
https://tecadmin.net/install-python-3-6-on-centos/
https://gist.github.com/dschep/24aa61672a2092246eaca2824400d37f (Raspbian)
https://unix.stackexchange.com/questions/332641/how-to-install-python-3-6 (debian)
Try running the command again with sudo as in sudo pip install darknetpy, or as a super user (typically gained with sudo su) then run the command normaly.
If you are still getting ImportErrors when you are trying to pip install something, try pip installing the module that is missing.
Related
I downgraded my Python from 3.9 to 3.8, but Pip was still installing to 3.9 after the downgrade so I uninstalled Pip. I tried to reinstalling pip using: python get-pip.py from pip's documentation and pip install --upgrade --force pip, and both gives the same error:
ERROR: Exception:
Traceback (most recent call last):
File "/Users/Dan/Library/Python/3.8/lib/python/site-packages/pip/_internal/cli/base_command.py", line 180, in _main
status = self.run(options, args)
File "/Users/Dan/Library/Python/3.8/lib/python/site-packages/pip/_internal/cli/req_command.py", line 204, in wrapper
return func(self, options, args)
File "/Users/Dan/Library/Python/3.8/lib/python/site-packages/pip/_internal/commands/install.py", line 449, in run
self._handle_target_dir(
File "/Users/Dan/Library/Python/3.8/lib/python/site-packages/pip/_internal/commands/install.py", line 503, in _handle_target_dir
shutil.rmtree(target_item_dir)
File "/usr/local/Cellar/python#3.8/3.8.10/Frameworks/Python.framework/Versions/3.8/lib/python3.8/shutil.py", line 718, in rmtree
_rmtree_safe_fd(fd, path, onerror)
File "/usr/local/Cellar/python#3.8/3.8.10/Frameworks/Python.framework/Versions/3.8/lib/python3.8/shutil.py", line 675, in _rmtree_safe_fd
onerror(os.unlink, fullname, sys.exc_info())
File "/usr/local/Cellar/python#3.8/3.8.10/Frameworks/Python.framework/Versions/3.8/lib/python3.8/shutil.py", line 673, in _rmtree_safe_fd
os.unlink(entry.name, dir_fd=topfd)
PermissionError: [Errno 13] Permission denied: 'RECORD'
When I run pip in terminal, I get:
Traceback (most recent call last):
File "/usr/local/bin/pip", line 5, in <module>
from pip._internal.cli.main import main
ModuleNotFoundError: No module named 'pip'
When I run which pip, I get:
/usr/local/bin/pip
The PermissionError you get makes me think you're not running it as sudo, especially since it's trying to use os.unlink. Try as sudo and see if it works then!
I have Python 3.6 correctly installed and have been working on Eclipse. But I cannot use the libraries. Every time I import them I get an error message:
Traceback (most recent call last):
File "C:\Users\gilbe\eclipse-workspace\python3.6\BeginnerFiles\IrisDataSet", line 1, in <module>
from sklearn import datasets
ModuleNotFoundError: No module named 'sklearn'`
When I tried installing sklearn, numpy, and scipy, I type in the following into Windows Command Prompt:
"pip install numpy", "pip install scipy", or "pip install sklearn".
However, I get an error message every time. For example:
C:\Program Files (x86)\Python36-32\Scripts>pip install sklearn
Collecting sklearn
Using cached https://files.pythonhosted.org/packages/1e/7a/dbb3be0ce9bd5c8b7e3d87328e79063f8b263b2b1bfa4774cb1147bfcd3f/sklearn-0.0.tar.gz
Collecting scikit-learn (from sklearn)
Using cached https://files.pythonhosted.org/packages/87/b7/0e7f5c0cf765cf4e1924c068e7b2e1708c93ebffde9302a57ea8f26619e9/scikit_learn-0.19.1-cp36-cp36m-win32.whl
Installing collected packages: scikit-learn, sklearn
Exception:
Traceback (most recent call last):
File "c:\program files (x86)\python36-32\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "c:\program files (x86)\python36-32\lib\site-packages\pip\commands\install.py", line 342, in run
prefix=options.prefix_path,
File "c:\program files (x86)\python36-32\lib\site-packages\pip\req\req_set.py", line 784, in install
**kwargs
File "c:\program files (x86)\python36-32\lib\site-packages\pip\req\req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "c:\program files (x86)\python36-32\lib\site-packages\pip\req\req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "c:\program files (x86)\python36-32\lib\site-packages\pip\wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "c:\program files (x86)\python36-32\lib\site-packages\pip\wheel.py", line 316, in clobber
ensure_dir(destdir)
File "c:\program files (x86)\python36-32\lib\site-packages\pip\utils\__init__.py", line 83, in ensure_dir
os.makedirs(path)
File "c:\program files (x86)\python36-32\lib\os.py", line 220, in makedirs
mkdir(name, mode)
PermissionError: [WinError 5] Access is denied: 'c:\\program files (x86)\\python36-32\\Lib\\site-packages\\scikit_learn-0.19.1.dist-info'
You are using pip version 9.0.3, however version 10.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Further, when I try to upgrade the pip command using the suggested command above, I also get an error message:
C:\Program Files (x86)\Python36-32\Scripts>python -m pip install --upgrade pip
Collecting pip
Using cached https://files.pythonhosted.org/packages/0f/74/ecd13431bcc456ed390b44c8a6e917c1820365cbebcb6a8974d1cd045ab4/pip-10.0.1-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 9.0.1
Uninstalling pip-9.0.1:
Exception:
Traceback (most recent call last):
File "C:\Program Files\Inkscape\python\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Program Files\Inkscape\python\lib\site-packages\pip\commands\install.py", line 342, in run
prefix=options.prefix_path,
File "C:\Program Files\Inkscape\python\lib\site-packages\pip\req\req_set.py", line 778, in install
requirement.uninstall(auto_confirm=True)
File "C:\Program Files\Inkscape\python\lib\site-packages\pip\req\req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "C:\Program Files\Inkscape\python\lib\site-packages\pip\req\req_uninstall.py", line 115, in remove
renames(path, new_path)
File "C:\Program Files\Inkscape\python\lib\site-packages\pip\utils\__init__.py", line 267, in renames
shutil.move(old, new)
File "C:\Program Files\Inkscape\python\lib\shutil.py", line 303, in move
os.unlink(src)
WindowsError: [Error 5] Access is denied: 'c:\\program files\\inkscape\\python\\lib\\site-packages\\pip-9.0.1.dist-info\\description.rst'
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
My real question here is how do I fix these issues, and install these libraries correctly, I have spent a whole day trying to fix this in different ways, including: installing the libraries from inside Eclipse, through Window>Preferences>Interpreter>Python Interpreter>Install with pip
, Uninstalling and Reinstalling Python, attempting to use the easy_install <package> command.
Please help.
right click on the windows button on bottom left of your screen.
Then go to "Windows PowerShell(Admin).
There you try your pip installs. It will definitely work. I think you don't have the admin access that is why you are seeing.
PermissionError: [WinError 5] Access is denied
Just open the cmd with admin as user.Hope this helps.
I'm trying to install pip with:
$ sudo easy_install pip
Getting this error:
Searching for pip
Reading https://pypi.python.org/simple/pip/
Couldn't find index page for 'pip' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
No local packages or download links found for pip
error: Could not find suitable distribution for Requirement.parse('pip')
I have checked that python is installed:
$ python --version
Python 2.7.10
According to multiple threads this should be working correctly, what am I doing wrong?
After downloading https://bootstrap.pypa.io/get-pip.py and running :
python get-pip.py
I'm getting this error:
Exception:
Traceback (most recent call last):
File "/var/folders/1y/4bcsjv_97t3793jlxscvccb07rjdl6/T/tmpvjuB2G/pip.zip/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/var/folders/1y/4bcsjv_97t3793jlxscvccb07rjdl6/T/tmpvjuB2G/pip.zip/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/var/folders/1y/4bcsjv_97t3793jlxscvccb07rjdl6/T/tmpvjuB2G/pip.zip/pip/req/req_set.py", line 784, in install
**kwargs
File "/var/folders/1y/4bcsjv_97t3793jlxscvccb07rjdl6/T/tmpvjuB2G/pip.zip/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/var/folders/1y/4bcsjv_97t3793jlxscvccb07rjdl6/T/tmpvjuB2G/pip.zip/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/var/folders/1y/4bcsjv_97t3793jlxscvccb07rjdl6/T/tmpvjuB2G/pip.zip/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/var/folders/1y/4bcsjv_97t3793jlxscvccb07rjdl6/T/tmpvjuB2G/pip.zip/pip/wheel.py", line 316, in clobber
ensure_dir(destdir)
File "/var/folders/1y/4bcsjv_97t3793jlxscvccb07rjdl6/T/tmpvjuB2G/pip.zip/pip/utils/__init__.py", line 83, in ensure_dir
os.makedirs(path)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pip'
Why not follow the official doc?
To install pip, securely download get-pip.py. 2
Then run the following:
$ python get-pip.py
from official doc of pip
and the actual link to get-pip.py
if you want to install for a specific python version on your machine
python2.7 or python3.x instead of python.
This question already has an answer here:
Installing pip on Mac OS error - Permission denied: '/Library/Python/2.7/site-packages/pip'
(1 answer)
Closed 6 years ago.
I am very new to python and have recently installed python 3.5.1 and am trying to install the module 'requests' by writing the following in terminal:
pip install requests
However I am receiving the following error. Thank you so much in advance for any help that you can give!
Collecting requests
Using cached requests-2.9.1-py2.py3-none-any.whl
Installing collected packages: requests
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-8.1.0-py2.7.egg/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-8.1.0-py2.7.egg/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip-8.1.0-py2.7.egg/pip/req/req_set.py", line 732, in install
**kwargs
File "/Library/Python/2.7/site-packages/pip-8.1.0-py2.7.egg/pip/req/req_install.py", line 835, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/Library/Python/2.7/site-packages/pip-8.1.0- py2.7.egg/pip/req/req_install.py", line 1030, in move_wheel_files
isolated=self.isolated,
File "/Library/Python/2.7/site-packages/pip-8.1.0-py2.7.egg/pip/wheel.py", line 344, in move_wheel_files
clobber(source, lib_dir, True)
File "/Library/Python/2.7/site-packages/pip-8.1.0-py2.7.egg/pip/wheel.py", line 315, in clobber
ensure_dir(destdir)
File "/Library/Python/2.7/site-packages/pip-8.1.0- py2.7.egg/pip/utils/__init__.py", line 83, in ensure_dir
os.makedirs(path)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/requests'
You're attempting to install requests to a place you do not have permissions to do so.
If you sudo it, ie. sudo pip install requests it will succeed. Else you can look into virtual environments to manage dependancies locally.
Also, you're installing the Python 2.7.x version of requests, due to using the Python 2.7.x version of pip. You'll need to use the pip for 3.5 explicitly if that's the one you want to install. There will either be a pip3.5 binary, or you can launch it with the full path to pip for Python 3.5.x
Having issues installing some python modules (for example pandas) and also had some issues installing ipython notebook.
This error seems to have come up before for other folks (Python pip install fails: invalid command egg_info), but they were using Python 2.7, whereas I'm using 2.6 (default with my Mac OS 10.6). Also I tried easy_install -U setuptools and pip install --upgrade setuptools but neither worked.
This is the error I get for installing pandas:
Command python setup.py egg_info failed with error code 1 in /private/var/folders/Wm/WmmbYincEnuCrAMtGBudAk+++TM/-Tmp-/pip_build_AWal/pandas
Storing debug log for failure in /Users/AWal/Library/Logs/pip.log
For installing iPython, this is the error that I get:
Exception:
Traceback (most recent call last):
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/req.py", line 1435, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/req.py", line 671, in install
self.move_wheel_files(self.source_dir, root=root)
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/req.py", line 901, in move_wheel_files
pycompile=self.pycompile,
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/wheel.py", line 341, in move_wheel_files
generated.extend(maker.make_multiple(['%s = %s' % kv for kv in console.items()]))
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/_vendor/distlib/scripts.py", line 316, in make_multiple
filenames.extend(self.make(specification, options))
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/_vendor/distlib/scripts.py", line 305, in make
self._make_script(entry, filenames, options=options)
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/_vendor/distlib/scripts.py", line 209, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/_vendor/distlib/scripts.py", line 189, in _write_script
self._fileop.write_binary_file(outname, script_bytes)
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/_vendor/distlib/util.py", line 384, in write_binary_file
with open(path, 'wb') as f:
IOError: [Errno 13] Permission denied: '/usr/local/bin/sphinx-apidoc'
Storing debug log for failure in /Users/AWal/Library/Logs/pip.log
Any thoughts on what to do?
UPDATE:
When I do sudo pip install pandas (another module that I can't install), I get a long long traceback with the end error message:
RuntimeError: Broken toolchain: cannot link a simple C program
And traceback (a sample of it of the 100 or so lines) looks like this:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/private/tmp/pip_build_root/pandas/setup.py", line 619, in <module>
**setuptools_kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/core.py", line 113, in setup
File "build/bdist.macosx-10.6-universal/egg/setuptools/dist.py", line 266, in __init__
File "build/bdist.macosx-10.6-universal/egg/setuptools/dist.py", line 312, in fetch_build_eggs
File "build/bdist.macosx-10.6-universal/egg/pkg_resources/__init__.py", line 753, in resolve
File "build/bdist.macosx-10.6-universal/egg/pkg_resources/__init__.py", line 1005, in best_match
File "build/bdist.macosx-10.6-universal/egg/pkg_resources/__init__.py", line 1017, in obtain
File "build/bdist.macosx-10.6-universal/egg/setuptools/dist.py", line 379, in fetch_build_egg
File "build/bdist.macosx-10.6-universal/egg/setuptools/command/easy_install.py", line 619, in easy_install
A permission Denied message would suggest you to run your command as root as suggested by Hackaholic.
try sudo pip install YOUR_PACKAGE
You might also want to have a look at virtualenv to use a more isolated environment.
Under debian based distributions, you might install python-virtualenv package with apt-get install python-virtualenv.
Then create a virtual environment names whatever by typing virtualenv whatever (this will create a folder whatever inside your current folder.
Then cd to it and type bin/activate to enter this virtual environment.
From there try again your pip install command.
Might help
UPDATE :
You might try to use the suggested solutions available here
To sumup, try to add export ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future inside ~/.bash_profile
This question comes first in Google, but the second one actually worked:
pip install -U setuptools
pip install ez_setup