permission denied
I was trying to install Django using pip3 install django==2.0.2 on windows.
But I am getting "permission denied " error message.
But pip3 install django==2.0.2 --user is working, but "Django-admin" command is not being recognized.
Please help me out.
C:\Users\Hima>pip3 install django==2.0.2
fd = os.open(file, os.O_RDWR | os.O_CREAT | os.O_EXCL)
PermissionError: [Errno 13] Permission denied: 'c:\\program files (x86)\\python38-32\\Lib\\site-packages\\accesstest_deleteme_fishfingers_custard_gijd2m'
Your installation with --user argument works because --user makes pip install packages in your home directory instead of system directory, which doesn't require any special privileges. You have not enough privileges to install it to system dir.
If you are sure of what you are doing - run pip with administrative privileges but do remember that anyone can uploade libraries to pip and thus there is a risk of running malicious code.
Better way to go is to use a virtual environment
Related
i'm typing the following in my working amazon ec2 linux server. (with ENV activated)
pip install pillow
getting this error:
Could not install packages due to an EnvironmentError:
[Errno 13] Permission denied: '/home/ec2-user/env/lib64/python3.5/site-packages/Pillow-5.1.0.dist-info'.
Consider using the `--user` option or check the permissions.
if i use --user i get:
Can not perform a '--user' install. User site-packages are not visible in this virtualenv.
Based on your answers, what happened is that you used sudo when you created the virtualenv so root owns it.
sudo chown ec2-user:ec2-user -R ~ec2-user/env will fix this and make ec2-user the owner of the directory (and subdirectories) again.
I'm trying to install data set on Ubuntu and when I use
pip install dataset
it gives me a long error message, and from what I could debug from it is that permission to the directory is denied. When I try
easy_install dataset
it says error: can't create or remove files in install directory because permission is denied Maybe my account doesn't have write access to this directory?
If you're receiving the error can't create or remove in install directory because permission is denied then you need to run your commands with sudo privileges
Try:
sudo pip install dataset
or
sudo easy_install dataset
I am trying to install Django 1.8.0 on my Ubuntu like this:
pip install Django==1.8.9
And this is the error Im getting:
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/Django-1.8.7.dist-info'
Any idea what's the problem?
Run in shell:
sudo pip install Django==1.8.9
But, as said in comments, you better use virtualenv with or without virtualenvwrapper. If you have python 3.3+ the recommended approach is to use pyvenv (with or without virtualenvwrapper) instead of virtualenv.
I've got to setup a new Django website on a webfaction account, getting issues when I try to run pip this is the error I get when I run
pip install south
OSError: [Errno 13] Permission denied: '/tmp/pip-build/virtualenv'
Webfaction provides instructions on how to install pip and pip packages for use within your local home directory...
http://docs.webfaction.com/software/python.html#installing-packages-with-pip
If you plan on hosting multiple web applications from the same webfaction server, it's probably wise to setup virtualenvs for each application. To do this, I would try the following...
pip install --user virtualenv # install virtualenv via pip
echo 'export PATH="$HOME/bin:$PATH"' >> $HOME/.bashrc # add local bin directory to PATH
source $HOME/.bashrc # reload .bashrc to kick in PATH changes
virtualenv yourvirtualenv --no-site-packages
Hopefully that works. I don't have Webfaction to test but I think that should suffice.
I am trying to run a python tool that will authenticate me to linkedin, in order for me to download my linkedin network so that I might be able to analyze it inside of Gephi. I obtained such a file here:
linkedin-1-oauth.py from github
I cloned that and the two other files he has in the gist. I did this from my terminal by just doing git clone [url here] for all 3 of the files. I put my api and secret keys in the corresponding places.
I did a pip install oauth2 and updated httplib2 as suggested here:
pip install oauth2 and update httplib2
I also did this from the command line, which downloaded and installed the files in the same directory as to where I downloaded the linkedin files from gist, just all in my user folder.
When trying pip install oauth2 and get the following error message:
Downloading/unpacking oauth2
Running setup.py egg_info for package oauth2
Requirement already satisfied (use --upgrade to upgrade): httplib2 in /usr/lib/python2.7/dist-packages (from oauth2)
Installing collected packages: oauth2
Running setup.py install for oauth2
error: could not create '/usr/local/lib/python2.7/dist-packages/oauth2': Permission denied
Complete output from command /usr/bin/python -c "import setuptools;__file__='/home/steven/build/oauth2/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-e2RkcV-record/install-record.txt:
running install
running build
running build_py
running install_lib
creating /usr/local/lib/python2.7/dist-packages/oauth2
error: could not create '/usr/local/lib/python2.7/dist-packages/oauth2': Permission denied
----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/home/steven/build/oauth2/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-e2RkcV-record/install-record.txt failed with error code 1
Storing complete log in /home/steven/.pip/pip.log
I then tried easy_install oauth2 and got the following error message:
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/test-easy-install-4349.pth'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/usr/local/lib/python2.7/dist-packages/
Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account. If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.
For information on other options, you may wish to consult the
documentation at:
http://packages.python.org/distribute/easy_install.html
Please make the appropriate changes for your system and try again.
So then I tried doing sudo apt-get install oauth2 and it could not be found
I am running Ubuntu 12.04 LTS I did all my sudo update and upgrades before I did anything else this morning. I am running python 2.7
Thank you
I was able to fix the problem by going here:
python-oauth2
Steps to install python oauth2 library on windows
Download http://python-distribute.org/distribute_setup.py and copy wherever python was installed
Run "python distribute_setup.py"
Download and unzip Oauth2 to a directory. Navigate to this directory.
Run "python setup.py install" to install ouath2
if you have python 2.7.10 or higher here is simpler method.
Use 'pip' to install python modules.
Say in my case on windows following does the trick.
C:\Python27\Scripts\pip install ouath2