Python easy_install gives [errno13] - python

I'm tring to install Hookbox but without success, when I call easy_install or
python setup.py install
it gives me [Errno 13] Permission denied: '/usr/local/lib/python2.6/site-packages/test-easy-install-68779.write-test'
When I try to grant write permissions to this derectory it gives
chmod: /usr/local/lib/python2.6/site-packages/: Operation not permitted
is there any way to solve this prob or install hookbox without easy_install?

You should have used appropriate privilege to install
sudo python setup.py install
Another option is to use virtualenv to create a isolated environment where you could install
http://pypi.python.org/pypi/virtualenv
Another way is too install some where, where you have permission.
python setup.py install --home=<dir>
see also the alternate unix installation with option prefix
python setup.py install --prefix=/usr/local
See the details of these options in the docs: http://docs.python.org/install/
If you ask my preference it would be virtualenv, virtualenvwrapper, pip and yolk to manage external modules. google for them

Related

Python Pipenv Install: EnvironmentError: Permission Denied

Trying to install python-decouple inside a pipenv shell:
(projectname) username#host: pipenv install python-decouple
But I'm getting this following error:
Installing python-decouple…
Error: An error occurred while installing python-decouple!
Error text: Processing /home/username/.cache/pipenv/wheels/6d/5a/2d/acfg...422fd/python_decouple-3.3-py3-none-any.whl
Installing collected packages: python-decouple
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/home/username/.local/share/virtualenvs/projectname-J2Y6DseW/lib/python3.6/site-packages/__pycache__/decouple.cpython-36.pyc'
Consider using the `--user` option or check the permissions.
I realize that I can install this package from outside the pipenv shell using:
python3 -m pip install --user python-decouple
But this would mean that this dependency wouldn't be managed by Pipenv when someone tries to replicate my project environment using Pipenv...
How can I get around this issue and what is the reason for it, what kind of permissions could I set on the file to overcome it?
Use it at your own risk:
The following solution works:
Run:
sudo chmod 777 /home/username/.local/share/virtualenvs/projectname-J2Y6DseW/lib/python3.6/site-packages/__pycache__
After this, try installing with pipenv again from within the pipenv shell.
I don't know whether this is a good solution or not, so please correct me if you have a better solution.
Just my two cents here:
I would modify the requirements.txt (every virtual environment should have one, or at least setup one for maintaining dependencies), by adding package for python-decouple. The current version is 3.3, so add this somewhere in the file: python-decouple==3.3 and re-run the virtual environment or install requirements.txt again.
See this link for more information on this package.

Access is denied when trying to pip install a package on Windows

How to set path for python 3.7.0?
I tried the every possible way but it still shows the error!
Could not install packages due to an EnvironmentError: [WinError 5]
Access is denied: 'c:\program files (x86)\python37-32\lib\site-packages\pip-10.0.1.dist-info\entry_points.txt'
Consider using the --user option or check the permissions
Add --user to the command.
eg:
pip install -r requirements.txt --user
Append the --user modifier to your command as suggested in the error.
--user makes pip install packages in your home directory instead, which doesn't require any special privileges.
More: What is the purpose "pip install --user ..."?
Run your command Prompt on Admin-Mode in Windows,it will stop throwing errors for user-rights.
Steps:
On Windows, type "Cmd" on searchbox to search for command prompt.
When "Command Prompt" search result appears,right-click>Run as Administrator.
You can add --user in the end of your command. This works well in my case!
--user
My example:
python -m pip install --upgrade pip --user
Just try on Administrator cmd
pip install --user numpy
Run your command prompt on admin mode.
type :
cd\
then type:
cd [Your python location path]
on mycomputer it's:
cd C:\Users\hp\AppData\Local\Programs\Python\Python37-32
then type:
python -m pip install --upgrade pip
You can follow this guide~
https://datatofish.com/upgrade-pip/
I had the same problem.
After installing Python for all the users, wanted to install Django.
For that I've gone to the Command Prompt (without using Admin mode) and
pip.exe install django==2.2
This prompted the following message
Could not install packages due to an EnvironmentError: [WinError 5]
Access is denied: 'c:\program
files\python37\lib\site-packages\pip-19.0.3.dist-info\entry_points.txt'
Consider using the --user option or check the permissions.
The way I've used to solve it was to add --user in the end of the command, just like the prompt message suggests («Consider using the --user»).
pip.exe install django==2.2 --user
Then everything worked fine.
The question was for windows but if any linux users that stumbled here (like me) : Permission Error Persists by adding --user in my virtualenv on Ubuntu 19 when I want to generate requirements.txt. Also, I can't pip install --user as well since I'm in an virtualenv. My solution was just using sudo pip3 install pipreqs to install another pipreqs for super user.
I wanted to throw an answer out here because I've been against a rock wall since upgrading to python 3.18. Pip install stopped working with a module error which was rectified with py -m pip install --user. but I would still get this permissions error. I uninstalled, reinstalled, and downgraded Python and Pip. I ran command prompt as administrator. None of it worked.
The only thing that worked was to pip download and then pip install the package from my c:/ drive. Totally BS workaround, but if you'r as stuck as I was it works.

Permission denied with trying to use pip on MAC?

Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/beautifulsoup4-4.6.0.dist-info'Consider using the `--user` option or check the permissions.
The error above is the one I get when I try to use the pip command. All I need to do is pip install the requirements.txt to get my program to work. I have python 2.7.1 installed and placed my code where I am able to use python commands. I tried to change permissions by using this command:
chmod -R 777
but it did not work. I have homebrew installed on my computer. I also tried to use a virtual environment using this link:
http://sourabhbajaj.com/mac-setup/Python/virtualenv.html but it gave me permission issues as well. Is there any suggestions to get rid of this permissions issue and run pip successfully? The sudo command below also doesn't work.
sudo pip install -r requirements.txt
This is a permissions issue.
Consider using pip install "packagename" --user as mentioned in the error.
This is covered HERE
try using sudo pip install djangorestframework for Mac. Worked for me.
It is likely that the directory where the package's entry point was installed is not in your PATH. For example, if it was installed /Users/username/Library/Python/3.7/bin/script, add PATH=$PATH:/Users/username/Library/Python/3.7/bin/ to your shell rc (.bashrc, .bash_profile, etc), and you should be good (and that will solve issues with other scripts installed to that /bin folder.

How to install Python Pandas?

I have a huge problem with Python packages. I'm completely newbie when it comes to Python and I'm having trouble for a long time. Anyway, I succeed in installing NumPy package and after that I can't install anything by simply using python setup.py install in the terminal.
I'd like to install pandas package, but I'm getting the same error every time:
[Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-539.pth'.
I went one step backward and tried to install "pip" and/or "setuptools", but I'm getting the same error [Errno 13] every time.
Is there a way to "easily" or even "understandably" install Python packages.
Permission denied error stems from not having write access when installing a package. On unix like systems the command is "sudo".
So, whatever package manager you use to download pandas, whichever package, start the command with "sudo" to ensure that you grant yourself write access for a download.
Example: (This is for a Linux box)
sudo apt-get install pip
And then with pip (the python package manager)
pip install <package-name>
With a Mac, you would either have to use homebrew or macports as your package manager.
Install homebrew like this:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
And then use brew to install pip
brew install pip
And just as before pip to install python packages
pip install <package-name>
Ok, this is not the answer to your question, but Anaconda works flawless for Linux. But I guess it is the same for Apple: http://continuum.io/downloads#py34
While installing pandas, I had the error of
'Could not install packages due to environmental errors: ...'
while uninstalling python-dateutil 1.5 .
It was solved using this command.
sudo pip install --ignore-installed python-dateutil pandas
you can use easy_install too:
first install easy_install tool and then use it like:
easy_install pandas
Thank you all for your help!!!
I'll suggest everyone facing the same problem to install brew and then follow the steps posted above.
If you still have problem ([Errno 13]), try with "sudo su" first, then follow the installation steps you need.
Best,
Zona
you can try the following.
sudo easy_install pandas

pip installs packages, but doesn't mark them as executable, so python doesn't find them

I've been trying to use sudo to install python packages on a system that I am on the sudoers list, but don't have general root access (i.e. don't have the password for su). I can install packages, for example
sudo pip install django
however when I try and use them python simply claims not to have the package installed. Investigating the contents of /usr/lib/python it appears that other packages directories and .eggs have executable permissions for ugo, however the packages I install using sudo pip do not have this permission. Manually giving these files executable permissions fixes the problem, but that is laborious, particularly when pip installed several dependencies that I need to chase up.
Is this a known issue? What can I do about it? For the record this is a RHEL6.4 machine and I'm using pip 1.4.1.
You best bet is virtualenv Do your workaround to install the virtualenv.
sudo pip install virtualenv
Resources for virtualenv to get you started:
http://simononsoftware.com/virtualenv-tutorial/
http://www.virtualenv.org/en/latest/

Categories

Resources