I want to use
virtualenv with Python 3 on Ubuntu 18.04. Specifically, I'm using Python 3.6.6 and virtualenv 16.0.0.
I installed virtualenv with
sudoas suggested in the answers here:
sudo pip3 install --upgrade virtualenv
I created a new virtualenv using
python3 -m virtualenv venv. And activated it as usual:
When I try to install my Python project with
python setup.py installI get the following error message:
running install running bdist_egg running egg_info error: [Errno 13] Permission denied
If I use
sudo to create the virtualenv in step 2, then I get a different error message in step 3:
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: '/home/stefan/git-repos/tng-sdk-project/venv/lib/python3.6/site-packages/test-easy-install-3769.write-test' The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: /home/stefan/git-repos/tng-sdk-project/venv/lib/python3.6/site-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: https://setuptools.readthedocs.io/en/latest/easy_install.html Please make the appropriate changes for your system and try again.
I've been googling and trying stuff for hours now and I can't get it to work properly. It seems like whatever I try leads to more, new errors... Any ideas?
sudo python setup.py install works inside the virtualenv, but this can't be the solution.