I'm seeing a weird situation when using packages -...
# python
b
I'm seeing a weird situation when using packages -- I list the requirement in the
requirements.txt
file then run the command
/venv/bin/pip install pulumi-local
which completes successfully. I confirm that its stored in the virtual environment with
pip show pulumi_local
. However, when I use that as an import, I get the following error:
Copy code
import pulumi_local as local
    ModuleNotFoundError: No module named 'pulumi_local'
Anyone else see this before or know how to solve it? Thanks!
b
Hey Kurt. There are few things that could be causing this. 1. Have you restarted the terminal? Packages are never visible in the system path until a restart is performed. 2. Check file structure. The parent folder requires a setup.py file, as well as an init.py file, then another one per each subpackage in the parent folder. 3. Check your path to ensure that it is in a visible location: "echo %PATH%" a. If not visible, you can locally append to your system path for a temporary fix: i. import sys ii. sys.path.append('/path/to/my-project/src') b. You can also perform a more permanent fix using the PYTHONPATH variable. i. set PYTHONPATH=path\to\root folder