Python Forum
PERMISSION DENIDED ERRNO 13 - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: PERMISSION DENIDED ERRNO 13 (/thread-15442.html)



PERMISSION DENIDED ERRNO 13 - ambush - Jan-17-2019

HI

I am trying to install flake8 on virtualenv but i was unable to do so due to following error

Exception:
Error:
Traceback (most recent call last): File "/home/sai/calculator/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/home/sai/calculator/lib/python3.6/site-packages/pip/commands/install.py", line 360, in run prefix=options.prefix_path, File "/home/sai/calculator/lib/python3.6/site-packages/pip/req/req_set.py", line 784, in install **kwargs File "/home/sai/calculator/lib/python3.6/site-packages/pip/req/req_install.py", line 851, in install self.move_wheel_files(self.source_dir, root=root, prefix=prefix) File "/home/sai/calculator/lib/python3.6/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files isolated=self.isolated, File "/home/sai/calculator/lib/python3.6/site-packages/pip/wheel.py", line 345, in move_wheel_files clobber(source, lib_dir, True) File "/home/sai/calculator/lib/python3.6/site-packages/pip/wheel.py", line 323, in clobber shutil.copyfile(srcfile, destfile) File "/usr/lib/python3.6/shutil.py", line 121, in copyfile with open(dst, 'wb') as fdst: PermissionError: [Errno 13] Permission denied: '/home/sai/calculator/lib/python3.6/site-packages/__pycache__/mccabe.cpython-36.pyc'
I need to know what are Probable solutions for the problem.Please let me know


RE: PERMISSION DENIDED ERRNO 13 - metulburr - Jan-18-2019

sudo the command
if it is the previous command
sudo !!



RE: PERMISSION DENIDED ERRNO 13 - snippsat - Jan-18-2019

Should not need to use sudo as virtual environment should be user based.
(Jan-17-2019, 05:56 PM)ambush Wrote: I am trying to install flake8 on virtualenv
How are you creating the virtual environment,is calculator your environment folder do you see see (calculator)?
Now also virtual environment is build into python trough venv.
Example:
tom@tom:~$ python -m venv my_env
tom@tom:~$ cd my_env
tom@tom:~/my_env$ source bin/activate

# Active see (my_env)
(my_env) tom@tom:~/my_env$ pip install flake8
Collecting flake8  
Installing collected packages: pyflakes, mccabe, pycodestyle, flake8
Successfully installed flake8-3.6.0 mccabe-0.6.1 pycodestyle-2.4.0 pyflakes-2.0.0

(my_env) tom@tom:~/my_env$ python 
Python 3.7.2 (default, Jan 16 2019, 23:14:35) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import flake8
>>> flake8.__version__
'3.6.0'
>>> exit()