user3565923
user3565923

Reputation: 340

No activate in venv

There is no activate script in my virtual environment's bin folder. Only files are: python, python3, python3.9.

How to fix my environment without deleting it? I'm using venv not virtualenv. I'm using Linux.

My problem is similar to this one - There is no activate when I am trying to run my virtual env

One of answers says I should run.

python3.7 -m venv venv

But I don't understand this syntax. Should I literally write python3.9 -m venv venv into my terminal? Will it fix my enviroment?

Also I want to say that newly created environments work as expected and all the others too.

Upvotes: 3

Views: 6963

Answers (3)

rad2
rad2

Reputation: 11

I installed python3-venv via apt and after immediately creating venv I didn't have activate script too. For me personally the solution was to close terminal, reopen it, delete venv folder and run

python3 -m venv venv

to create venv again. After it the ./venv/bin/activate was in place.

Upvotes: -1

Saniar Mofidi
Saniar Mofidi

Reputation: 1

i think this is helpfull for you

but for basic use it like this:

python3.7 -m venv myenvname
source myenvname/bin/activate

and if activate isnt there try to find that in sub directories

Upvotes: -3

Brent
Brent

Reputation: 1498

I had this problem with python 3.10, I had to install venv for my version otherwise I was missing the activate script. (I am using the deadsnake ppa on ubuntu) after this the activate script appears when creating new venv.

sudo apt-get install python3.9-venv

I documented the full python 3.10 on Ubuntu installation here

Upvotes: 5

Related Questions