Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

creating python virtual env on Linux

I'm new to Linux environment where i need to create a virtual environment for my project. As this is a development machine i will not have access like i used to have in my own machine. I tried running the below commands :

python3 -m venv env 

But got permission denied:

I tried using sudo su command upon which it asked to enter my password. Later it said "Sorry, user xxxx is not allowed to execute 'usr/bin/su' as root on

Is this meant i do not have access to run sudo command?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The "permission denied" error is probably due to the fact that you are in a directory where you have no write rights

Solution:

  1. either change directory (for instance with cd, this will take you to your $HOME where you certainly have write rights)

or

  1. give a full path for directory where you want to save the virtual environment (for instance to save in ~/my_env use python3 -m venv ~/my_env)

By issuing the command

python -m venv -h

you can see all the options of venv.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...