Answer the question
In order to leave comments, you need to log in
How to change sys.path in venv?
Python in venv is not looking for modules in the right folders
To get python to look for them, I do the following:
import sys
sys.path.append('/pathtofolder/')
Answer the question
In order to leave comments, you need to log in
What are the modules?
If they are pip packages, they need to be installed to that particular venv using local pip.
If these are your own modules that you use often, you can try to create your own package and install it like any other. The package does not need to be downloaded by pypi.org, pip installs packages from a file just fine.
If these are local project modules, then you need to look at the directory structure of this project.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question