-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent ModuleNotFoundErrors #1456
Comments
Very interesting. Maybe the two call different installed versions of Python? |
If porcupine finds a python virtual environment, it will automatically activate it before running the script. Is the other file, by chance in a project that has a python venv? |
You can control venvs by right-clicking them in the directory tree at left. The currently selected one (if any) shows up with a yellow "venv" in front of it. You can see which venv Porcupine uses based on the blue command that Porcupine displays when a file runs. With a venv in use, the command is two lines (first line activates venv). Without a venv in use, the command is one line. |
So in a way I was kinda right?? |
Thanks for all of the replies! |
Another thing, file one is located in my home dir, but file two is in a GitHub repo. |
The porcupine-venv is meant to be used only for Porcupine and its dependencies, not for your projects, so we could adjust Porcupine's auto-detecting logic so that it never uses a venv that is named Currently the auto-detect logic is:
You don't update the venv, you install the dependencies into that venv. This way, if you want to uninstall the things you installed, just delete the whole venv. When you install a dependency into a venv, everything installs into the venv folder. That's the whole point of venvs: you don't pollute your system's Python with all your projects' dependencies. I recommend making one venv for each project. To install something into the venv, you activate the venv (with And again, all of this should be documented, but it isn't... |
I started documenting this. For taking screenshots, I temporarily cleared my Porcupine settings. As you might have guessed, Porcupine found my Please make a pull request that skips folders named |
👍 Will do! |
This is now documented in |
I have two tabs open, both of them Python files.
When I try to run tab one, I get this error:
When I run tab two I don't get any errors.
The funny thing is... both tab one and tab two contain the same import:
import cv2
This has been bugging me for a while, with multiple different imports and projects, but I've been to lazy to report it. 😊
The text was updated successfully, but these errors were encountered: