DUDANF
DUDANF

Reputation: 3000

VirtualEnv Module not found when creating env

I've searched but seems like most posts cannot find modules, once they are in the environment. My problem however is quite strange. I am getting a ModuleNotFound error when initialising my env.

daudnadeem$ virtualenv py-tpot
ModuleNotFoundError: No module named 'google'

Even though it shouldn't matter, google is installed.

daudnadeem$ pip install google
Requirement already satisfied: google in /usr/local/lib/python3.7/site-packages (2.0.3)
Requirement already satisfied: beautifulsoup4 in /usr/local/lib/python3.7/site-packages (from google) (4.8.2)
Requirement already satisfied: soupsieve>=1.2 in /usr/local/lib/python3.7/site-packages (from beautifulsoup4->google) (2.0)

I tried uninstalling virtualenv, and reinstalling. That didn't work.

I managed to set up a vitualenv with python3 using: python3 venv myenv However I need a venv with python2.7 and python venv myenv does not work.

Anybody have any ideas?

Upvotes: 0

Views: 1799

Answers (1)

Simplecode
Simplecode

Reputation: 589

Have you tried virtualenv -p python venvname . Where python points to python 2 version.

Install virtualenv if not present and try the above command.

Upvotes: 2

Related Questions