I have a project that has code which will communicate with a python script and call python functions. In the proj file, i've added the includePath for the python header files, and added external python library to the project (python27.a). However the qt compiler gave me an error:
No rule to make target
/home/pgeng/work/OpenModelica-rev.9876.CSA/OMEdit/OMEditGUI/../../../../../../usr/lib/python2.7/libpython2.a
, needed by ../bin/OMEdit. Stop
What does this mean? How can i fix it? this is anything related to PyQt?
It seems like libpython2 is missing.
You will have to :
Find out what package provides this library.
You can Google for that.
Or search a repo for the lib.
Related
I'm using PythonKit with XCode to call spaCy API from swift code. Installed PythonKit from Home-brew, imported it in my project and it built well; however, at runtime I got the error:
Python library not found. Set the PYTHON_LIBRARY environment variable with the path to a Python library.
So I compiled PythonTools (within PythonKit dir, run swift package generate-xcodeproj and open PythonKit.xcodeproj file ) to see which paths of Python library it would find:
/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python37.zip
/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7
/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload
/Users/fernandabrum/Library/Python/3.7/lib/python/site-packages
/usr/local/lib/python3.7/site-packages
If Python libraries are in my system, why I get an error of Python library not found? What am I doing wrong?
OBS.:I also tried to set PYTHON_LIBRARY with export PYTHON_LIBRARY= and the paths found above, but unsuccessful.
Thanks in advance!
In "Hardened Runtime" under Signing and Capabilities: check "Disable Library Validation"
See the answer here: I can't import Python modules in Xcode 11 using PythonKit
I finally solved this problem, in my case, by setting App Sandbox to NO in my app's .entitlements file. I also have Hardened Runtime and Enable App Sandbox set to NO in build settings, but those settings don't work without modifying the entitlements file... at least not in my case.
My understanding is that I can't distribute an app this way, so maybe kinda useless for some, but this is just a simple dev tool for testing some python code that will eventually be called from Vapor, so not a huge deal for me.
I have same issue. I try to use PythonLibrary.useVersion(3) and get same error as yours.
It looks like the python library does not support iOS yet. It is working fine on OS X.
I have a Windows machine in which some Python code works, but now needs to work on new machine.
I have installed the same Python version 3.6.5.
First issue was that when I run the code, it can not find a re.py library, which is in fact in Python's Lib folder. So I have added sys.path.append('C:\Python\Lib') and now it can find it.
But now I get the syntax error from that library, where I say import re, that lines throws an error regarding some line in re.py library. If I import getopt, I also get syntax error on some line.
How is that even possible? Syntax error in pythons Lib files which came with installation?
And the thing is that on machine 1 it works, same file contents, same python version. I am under impression that I have wrong in python.exe version for this version of libraries, but I have simply downloaded Windows installer and installed it.
I don't even know what to google for, does someone has any idea? I am importing re in WeblogicAuto.py on line 5.
D:\Jenkins\workspace\weblogic-full-deployment-copy\weblogic-deployment>MainAutoDeployment.py -f DEV -v 2.61.0.12
Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
Problem invoking WLST - Traceback (innermost last):
File "D:\Jenkins\workspace\weblogic-full-deployment-copy\weblogic-deployment\WeblogicAuto.py", line 5, in ?
File "C:\Python\Lib\re.py", line 247
b"_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890")
^
SyntaxError: invalid syntax
You are using WLST (WebLogic Scripting Tool).
WLST is very specific distribution of python:
it's jython
it roughly corresponds with python 2.7
And you trying to import libs from your CPython 3.6.5 distribution.
You need to:
remove your sys.path.append that you added earlier
check python libraries in jython library path. Which could be $HOME/.jython or WLST-specific path (look in WebLogic documentation)
OK many thanks to ya all, I've found the solution, it was about Jython libraries. I will try to elaborate a bit if someone stumbles upon this issue.
What I do here is that I deploy java modules to Oracle Weblogic application server. So this answer will also help someone trying to deploy to Weblogic from python.
From the start I was avoiding to install Webloglogic software on a machine from where I do the deploy (and that is a Jenkins slave which runs these python file, simple job).
I noticed that first machine (first Jenkins slave) has Weblogic installed, but I like to keep it minimal :)
What you do need is weblogic.jar and (not sure at this moment) wlfullclient.jar which is generated on Weblogic server (google how if needed or you may already have it).
The thing is that even though I have pure python code, when you call another python code with java weblogic.WLST pythonCode.py, it will be run with jython application! And it needs its libraries in its sys path.
In jython file I've added print(sys.path) then run in on both machines (slaves). I've noticed that path is different on those machines, even though if you type it in command prompt you get the same, but different then when Jenkins runs it.
So instead of looking how to fix those paths and copy files to them, I have created folders where it expects them, and copied them from first machine (easy fix, I may look into it later).
These are the sys.path and files that were needed, present on first machine:
['D:\\Jenkins\\weblogic\\Lib', '__classpath__', 'C:/bea10/wlserver_10.3/server/lib/weblogic.jar', 'C:/bea10/wlserver_10.3/common/wlst/modules/jython-modules.jar/Lib', 'C:/bea10/wlserver_10.3/common/wlst', 'C:/bea10/wlserver_10.3/common/wlst/lib', 'C:/bea10/wlserver_10.3/common/wlst/modules', '.']
This was sys.path on second machine, so I simply copied there:
['D:\\Jenkins\\weblogic\\Lib', '__classpath__', 'D:/Jenkins/server/lib/weblogic.jar', 'D:/Jenkins/common/wlst/modules/jython-modules.jar/Lib', 'D:/Jenkins/common/wlst', 'D:/Jenkins/common/wlst/lib', 'D:/Jenkins/common/wlst/modules', '.']
Note that jython-modules.jar is a file, so /Lib should be from that file if I get how java works.
Feel free to contact me for more details.
I'm working on creating an app from Python code using py2app.
Everything goes well until I run setup.py, then at the very end of it running I get this message: "ValueError:
'/Users/(my_computer_name)/anaconda3/lib/libpython3.6.dylib' does not exist"
It turns out there is a file there, just named slightly different: It asks for 'libpython3.6.dylib' and there is a file named 'libpython3.6m.dylib'
Any insight would be greatly appreciated, thank you!
Anaconda Python binaries are build with multithread support and that means the library generated will have the form *m.dylib ( see this Google Groups link )
You could create a symlink and try to build using py2app (I had issues with that).
Alternatively this worked for me: I had an equivalent virtualenv setup (which uses a Python Framework and makes py2app locate the library differently) and was able to build the application on that one.
While trying to use the RPi python module installed on RaspberryPi, using it in one of my request definition in views.py I get
Module not imported correctly!
This is the traceback that I got. Note that I'm using this repo as a starting point.
What would be the right way to install RPi and use it properly in Django ? I need RPi because of my motion sensor, using this tutorial as a starting point for motion sensor but want to integrate it to a django view (page)
After downloading the module, uncompress and unpack the downloaded file. Then, run the command "python setup.py install". This documentation on installing modules may be useful http://docs.python.org/2/install/.
As far as using the module with Django, I cannot really help with that. This page may help: https://docs.djangoproject.com/en/dev/intro/reusable-apps/.
i've built a com component which utilizes libxml2 python bindings , the build is successfull but when i try to register the component i get "specified module could not be found , unable to load python dll" this is the error i get when the component is built using the bundle files option set as 1
if i build the component with bundle files set as 3 ,then i get a different error saying that the component was loaded but the call to DllRegisterServer Failed with error code 80040201
if the libxml2 import is removed all works fine.
any help wold be simply great.
thanks
Most likely, regsvr32.exe which registers you COM component couldn't find a DLL that your COM component needs.
I'm not familiar with Python COM components but is there some way you can run depends.exe on it? This is the usual way to track down binary dependency problems.