I am trying to run a python script to pull a table from MariaDB. I can run it locally on the MariaDB I installed on my device but when I go to run it on my vm it throws the ModuleNotFoundError. If I run 'pip-safe list' it shows both modules are there but when I run the script I get the error above. I have also tried moving the location that the modules are stored to see if it was a directory issue. I think that it's simply an issue with the import syntax with the '.' in mysql.connector but I can't figure out why. If anyone could help me troubleshoot this that would be greatly appreciated.
Code
Error Message
"pip-safe" was installing the modules to a virtualenv within my system. Where as "sudo pip3" would install to a different directory. When I installed mysql-connector-python via "sudo pip3" and ran the same script I didn't get any errors.
I still don't fully understand why python3 wasn't able to find the modules that were istalled via "pip-safe" but the script is working.
Related
whenever I type, for an example: pip install aiohttp==3.7.3, it gives me: /usr/bin/env: ‘./python3’: No such file or directory is there any way to fix it? (The error is in REPLIT)
I had problems with using aiohttp in REPLIT, I tried uninstalling package files. I "reinstalled" packages, such as "aiohttp" after doing the problem referred to the title popped up in the console.
I ran into this error as well and haven't been able to solve it.
In the meantime, I use python3 -m instead and it works:
python3 -m <module-name> <args>
Well, go to .replit and delete the Variable called hidden = ["venv", ".config", "**/__pycache__", "**/.mypy_cache", "**/*.pyc"]
after deleting, go to the file directly and download the module to your computer, then upload it to the file it's not in.
I hope this works,
-JKID_Tech
P.S. I tried this IT WORKS if you get python from your computer then go to the python files or try to find it on the internet for example PyPI
I'm trying to run QT Designer from the terminal
pyside6-designer
but get the error message:
venv/lib/python3.8/site-packages/PySide6/designer: error while loading shared libraries: libQt6DesignerComponents.so.6: cannot open shared object file: No such file or directory
Inspecting the folder, I can confirm libQt6DesignerComponents.so.6 exist in the folder:
/venv/lib/python3.8/site-packages/PySide6/Qt/lib
I have re-installed and also tried the alternative PIPENV, but same result. Trying to execute in the same folder it ask me to install qtchooser. But didn't work after installing this.
I am on Ubuntu 20.04. I can find a ticket saying it should be solved. link to solution
I have also tried some random stuff, such as
sudo /sbin/ldconfig -v
which is described here its foss. It didn't work.
Anyone got experience of the same problem and have a solution?
Set your LD_LIBRARY path in shell (bash) after activating a venv:
export LD_LIBRARY_PATH=/home/FILL_IN_USERNAME/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/PySide6/Qt/lib/
I'm running Kubuntu Groovy Gorilla.
I'm quite excited about trying this out.
I'm going through the Flask tutorial, and I encounter a problem where I can't use pip (and thus anything else really) a venv in Powershell. The same flask app runs correctly in an Ubuntu terminal with Python 3.6.6 in WSL.
The problem seems to depend on the directory, which makes me think it's somehow related to file path length; I enabled long file paths in the windows Group Editor but this hasn't fixed the problem. In the below steps my venv directory is c:\users\rwgpu\google-drive\code\flask-tutorial\winEnvflaskr\ and I experience the error, but everything works correctly in the directory C:\python\test\testVenv. (in each case I'm running the commands in the directory one up from the listed above, flask-tutorial and test respectively)
Minimal steps to reproduce are:
Completely fresh Python 3.7 installation.
Change directory to app folder.
py -m venv winEnvFlaskr
./winEnvFlaskr/Scripts/activate
pip list
The ultimate goal is to then
pip install FLask
and run the Flask tutorial app. Again, all steps work correctly in Bash on Ubuntu in WSL (running its own Python) and in a different windows directory with the same Python 3.7.
After pip list I get the error:
Fatal error in launcher: Unable to create process using '"c:\users\rwgpu\google-drive\code\flask-tutorial\winenvflaskr\scripts\python.exe" "C:\Users\rwgpu\Google-Drive\Code\flask-tutorial\winEnvFlaskr\Scripts\pip.exe" list'
and if I try
python -m pip list
I get nothing; the terminal hangs for a second and returns with no output. If I run
py -m pip install -U pip
in the bugged venv it will try to install and report success. It will do this again, and will never report "requirement already satisfied" which would be correct.
I had the same problem on Windows with running flask in command line from venv(for example, "(venv)...\flask run"). I resolved the problem with changing path in flask.exe code(open "your_venv\Scripts\flask.exe" with notepad or etc.): in my way I correct the 436-th line at the end; you need to put there "your_absolute_path_to_venv\Scripts\python.exe" instead of the path indicated there.
Good luck!
Well, I still don't know why this was happening -- it persisted through deleting and recreating the venv (obviously), but when I deleted the entire folder, that somehow cleared it up. I just copied the code into a new directory in the same parent and everything seems to be working ¯\_(ツ)_/¯
If anyone knows what would cause this in my case I still welcome input.
I basically used the install command "$pip install Flask" and when I try to run a program it says "module can't be found." Flask is installed in "/usr/local/lib/python2.7/site-packages" but I thought the point of pip was so I could import these packages everywhere. I'm trying to run a file on my desktop and even when I move the Flask folder to the desktop, it doesn't work. Any advice? Thanks!
This may not directly solve whatever problem you are having with path variables, but one alternative would to download virtualenv
Flask actually has a good tutorial on how to accomplish this here
I have installed the K4W branch of the open kinect project on Linux 11.10 from https://github.com/renewagner/libfreenect/tree/k4w-wip . I can navigate to the directory libfreenect/build and run the command:
sudo bin/glview
and the output works correctly.
I have also installed the Python wrappers from libfreenect/wrappers/python and I can import the libraries successfully. However if I run a simple code such as
import freenect
freenect.sync_get_depth()
Which I saved as kinect1.py and then ran using the command sudo kinect1.py
I get the following error:
Error: Invalid Index[0]
Error: Can't open device 1.) Is it plugged in? 2.) Read README
However, I can go straight back to running the glview example and it still work find. So I must be missing something with the Python wrapper implementation. I hope someone can help.