aeb0
aeb0

Reputation: 816

Python does not find installed modules

Python3.5 does not locate installed modules when invoked in virtual env.

  1. Create virtual env: python3.5 -m venv autogit/venv && cd autogit
  2. source venv/bin/activate
  3. which python == ...autogit/venv/bin/python Weird, would expect python3.5
  4. Add my python source code to /autogit and pip freeze>requirements.txt
  5. pip install -r requirements.txt
  6. ls venv/lib/python3.5/site-packages shows request-0-0-0-py3.5.egg-info and some other stuff
  7. Since dependencies are installed under python3.5 and which python revealed python rather than python3.5, lets invoke the python3.5binary explicitly.... venv/bin/python3.5 autogit.py Get ImportError: No module named 'request

??? Where could python be looking for packages if not in my virtual env?

UPDATE The questions above remain unanswered; here are things I noticed since then and the workaround I used:

Upvotes: 2

Views: 1186

Answers (1)

Filipe Aleixo
Filipe Aleixo

Reputation: 4242

Have you got other Python versions installed? That might be the problem.

Try using pip3 instead of pip

Upvotes: 1

Related Questions