I am a relative newbie with Python and was trying to install wxPython 2.9 using Python 2.6. I did a build from source and then installed the package both being done in a non-standard (local) path. When I try and import wx (having provided the path to the installation folder in my environment variable), I get the following error message:
"ImportError:
libwx_gtk2u_xrc-2.9.so.1: cannot open
shared object file: No such file or
directory".
Can someone please tell me if I need to build gtk separately? And if yes, how do I go about doing it?
Add the directory containing the library given in the error to your ld search paths. See the ldconfig(8) man page for details.
Related
SkyNet is publicly available as an open-source software at https://bitbucket.org/jlippuner/skynet. I am having problems installing this software. I am using Ubuntu, and I have downloaded all needed packages using apt. All tests pass (not at first, but after restarting), but the problems start when I try to run the example code.
As instructed at the bitbucket page, I have used CMake to try to install the package, and all files seem to be installed, and the tests work.
The first line in the code is from SkyNet import *, but this just returns No module named 'Skynet' found. I have tried to reinstall and using different versions of Python, but it doesn't seem to work. Can anyone help me?
Going through the Skynet documentation install page I found this,
For python to find the Skynet module the directory in which it exists has to be added to PYTHONPATH environment variable.
Replace install_dir with directory where the Skynet module has been installed to.
echo "export PYTHONPATH=<install_dir>/lib:\$PYTHONPATH" >> ~/.bashrc
An alternative approach would be to add the path where Skynet module exists to sys.path at the top of your script file.
Example
import sys
sys.path.append("/usr/lib/Skynet")
from Skynet import *
Here is a link to documentation on how python resolves module imports
I am using ray library of python but I got an error even if I have the mentioned file.
The error is the following:
FileNotFoundError: Could not find module 'C:\Users\boezi\PycharmProjects\AWSDeepRacerChallenge\env\lib\site-packages\ray_raylet.pyd' (or one of its dependencies). Try using the full path with constructor syntax.
pip did not recognize the library, therefore I downloaded the wheel archive, I extracted it and I put the content in the site-packages folder of my virtual environment.
The package is recognized and I can use automatic filliing with my IDE but I have the aforementioned problem.
I installed Anaconda (Anaconda3-2020.07-Windows-x86_64, python 3.8). Following the installation guide, I didn't add Anaconda to the PATH environment variable. After installation, it works well when using Anaconda Prompt to start python.
Problem occurs when I use Python Launcher to start python from CMD:
In CMD, type "py" to launch python(The Python Launcher is able to find Anaconda python). Then when I attempt to import numpy, I get the following error:
Original error was: DLL load failed: The specified module could not be found.
And when I attempt to import sqlite3, I get the following error:
ImportError: DLL load failed while importing _sqlite3: %1 is not a valid Win32 application
If I use Anaconda Prompt to start python, I can suscessfully import numpy and sqlite3. I checked sys.path under these two situations and they are exactly the same.
Why? What's the difference between the two situations?
p.s.
I'm concerned with this problem because I built a website using "django + mod_wsgi + Apache", and when visiting the website from brwoser, the website got an "Internal Server Error". The error log shows that it is caused by the failure of importing numpy and sqlite3, just like the above errors.
What's the difference between the two situations?
The anaconda command prompt has added a bunch of paths to the PATH environment variable, e.g. for me it has added all of these locations:
C:\ProgramData\Miniconda3
C:\ProgramData\Miniconda3\Library\mingw-w64\bin
C:\ProgramData\Miniconda3\Library\usr\bin
C:\ProgramData\Miniconda3\Library\bin
C:\ProgramData\Miniconda3\Scripts
C:\ProgramData\Miniconda3\bin
C:\ProgramData\Miniconda3\condabin
In some of these locations there are executables like python.exe so that calling python will launch the anaconda installed version. Other folders in this list contain .dll files, i.e. libraries that your modules might depend on (like numpy or sqlite that are interfaces to functions written in c/c++). So even if you are calling the right python.exe, if the PATH is not set to include the locations of the neccessary dlls, then importing such packages will fail, as you can see in your error messages:
Original error was: DLL load failed: The specified module could not be found.
What you can do:
I am not an expert on configuring a django server, but by manually adding these locations to your PATH, you might be able to solve the issue.
I'm trying to follow this tutorial and I'm getting the following error:
ImportError: No module named django.core.management
I'm completely new to python. I believe Visual studio is using a version of python I already had installed in c:\Python27, could that be causing a problem?
Someone mentioned in a link I found that they had to copy the 'django' folder to the project folder, but I don't know where that would be. I don't even know what the error means really unless there's a missing package (like dll or assembly in .NET?), but I don't know what paths python would use to try to find a package or even what one would look like.
I see there's a PYTHONPATH environment variable that I don't have declared, should I declare that? Should it point to the C:\Python27 directory?
First, do you have checked your "Python Environment" in your project folder? It may seems like...
Here you may find your django with version. If you dont find it then compile setup.py from django folder again with desire python version. And then right click on "Python Environments" from your project and click on "Add/Remove Python Environments" to select python version.
Ok with a lot of fooling around I found this directory:
%LOCALAPPDATA%\Microsoft\Web Platform Installer\installers\PythonDetectInstalls
In a mangled sub-folder there is a powershell script DetectPythonInistalls.ps1 that has these two lines for checking if python is installed already:
$regKey = "hklm:SOFTWARE\Python\PythonCore\$pythonVersion\InstallPath";
$correctRegKey = "hklm:SOFTWARE\Wow6432Node\Python\PythonCore\$pythonVersion\InstallPath";
Uninstalling all my pythons did not remove these keys. After removing these registry keys with regedit, WPI allowed me to install its own version of python 2.7 and all the other goodies to go with the Windows Azure Python SDK and it worked.
I am having weird behaviors in my Python environment on Mac OS X Lion.
Apps like Sublime Text (based on Python) don't work (I initially thought it was an app bug),
and now, after I installed hg-git, I get the following error every time I lauch HG in term:
*** failed to import extension hggit from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-package/hggit/: [Errno 2] No such file
or directory
So it probably is a Python environment set up error. Libraries and packages are there in place.
Any idea how to fix it?
Notes:
I installed hg-git following hg-git web site directions.
I also added the exact path to the extension in my .hgrc file as: hggit = /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-package/hggit/
Python was installed using official package on Python web site.
Echoing $PYTHONPATH in term print anything
"site-package"? Did you mean "site-packages"?