When I try to install libmagic using pip install python-libmagic, I get the following error:
Could not install packages due to an EnvironmentError: [Error 13] Permission denied: 'c:\users\*****\anaconda\Lib\site-pakages\_cffi_backend.cp36-win_amd64.pyd'
Consider using the --user option or check the permissions.
What should I do to rectify this error?
You are trying to install the package to a system folder which you don't have permissions to write to.
You have two options(use only one of them):
1-setup a virtual env to install the package (recommended):
python3 -m venv env
source ./env/bin/activate
python -m pip install python-libmagic[samples]
2. install the package to the user folder:
python -m pip install --user python-libmagic[samples]
Related
I'm using Linux Mint 20.2 with two directories / and /home.
I used the following command to install virtualenv:
>>> sudo pip3 install virtualenv
It worked fine and it installed in the following path:
>>> virtualenv --version
virtualenv 20.0.17 from /usr/lib/python3/dist-packages/virtualenv/__init__.py
But when I tried to create an environment I got the following error:
>>> python3 -m venv article
The virtual environment was not created successfully because ensurepip is not
available. On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.
apt install python3.8-venv
You may need to use sudo with that command. After installing the python3-venv
package, recreate your virtual environment.
Failing command: ['/home/username/article_tools/article/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']
When I tried to uninstall it to install it using [b]sudo apt install python3.8-venv[/b], I got the following error:
>>> sudo pip3 uninstall virtualenv
Found existing installation: virtualenv 20.0.17
Not uninstalling virtualenv at /usr/lib/python3/dist-packages, outside environment /usr
Can't uninstall 'virtualenv'. No files were found to uninstall.
How can I fix it? By fix, I mean installing virtualenv in a way that I don't get such errors.
The fundamental problem here seems to be that you are mixing up two different packages.
Python 3 comes with a built-in virtual environment module venv which is however not installed by default on Debian-based platforms. Like the error message says, apt-get install -y python3-venv will install this package, which you can then use with python3 -m venv.
virtualenv is a separate third-party package which you invoke with the command virtualenv. It's not a bad alternative, but if you are only just learning, I would suggest you simply ignore it for the time being.
I want to install pip3 install twint but I get the error:
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/3.8'
Consider using the `--user` option or check the permissions.
what command do i need to type to install it under my user option?
would it be python -m pip3 install twint?
as suggested by pip, use --user: python3 -m pip install --user twint
it will install your package in your home (https://pip.pypa.io/en/stable/user_guide/#user-installs)
as a better alternative, you can look into virtual environments
Try installing this using the Anaconda Navigator cmd. The installation did not work in Jupyter Notebook, but it did work in Anaconda Navigator cmd.
After installing python 3.8, I cannot install module with pip:
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/.local/lib/python3.8/site-packages/enum34-1.1.10.dist-info'
Check the permissions.
Try to use sudo in the beginning of the command if you are in linux. Maybe you are bot using the system as a root
Add --user at the end
pip3 install package_name --user
I would try to use anaconda with the following command in the terminal:
conda install -c anaconda pip
If you don't have anaconda:
pip install conda
Recently I messed up my steady environment by installing multiple versions of python.
What I'm trying to do: install a particular package using pip
pip cannot install any package without the --user tag
Could not install packages due to an EnvironmentError: [Errno 13 Permission denied: '/Library/Python/2.7/site-packages/PIL
Here's More information:
which pip
/usr/local/bin/pip
which python
/usr/bin/python
What should I do?
Use sudo or su to install packages system-wide.
I have the neurolab package version 0.2.0 in /usr/local/lib/python2.7/dist-packages.
Now I would like to install neurolab version 0.1.0 in a virtual environment.
This is after installing pip and virtualenv:
~$ mkdir neuro_env
~$ cd neuro_env
~/neuro_env$ virtualenv envi
~/neuro_env$ source envi/bin/activate
(envi)~/neuro_env$ pip install neurolab==0.1.0
Then the install fails, with at the end of the error the line:
IOError: [Errno 13] Permission denied: '/home/username/.pip/pip.log'
But when I install it with permissions like this:
(envi)~/neuro_env$ sudo pip install neurolab==0.1.0
Then version 0.1.0 is just installed globally again (in /usr/local/lib/python2.7/dist-packages)
I read I could use the -E flag, but that is not possible anymore it seems:
error: no such option: -E
So how do I install neurolab version 0.1.0 only for my project in~/neuro_env?
Edit
(envi)~/neuro_env$ ls -l /home/username/.pip
total 4
-rw-r--r-- 1 root root 874 2012-07-28 13:18 pip.log
The problem is that your /home/username/.pip/pip.log file is only writable by root, so when you try to use pip as another user you don't have permission to update the log file and the whole operation fails.
Changing the ownership of the log file (using sudo chown username:username /home/username/.pip/pip.log) or removing it (using sudo rm /home/username/.pip/pip.log) should fix your problem.
if you are using windows. type in powershell or terminal:
python -m pip install WHATEVER