Im running Python Web pages with Apache/Lampp in Ubuntu 18.04, and I have a code that's already running ok in terminal, but when I run on browser with Apache I get this error:
/usr/lib/x86_64-linux-gnu/libharfbuzz.so.0: undefined symbol FT_Get_Var_Blend_Coordinates
This error occurs when i try to import the "non_max_supression" from imutils.
With just this lines of code:
#!/usr/bin/python3.6
print("Content-Type:text/html;charset=utf-8\n")
import sys
try:
from imutils.object_detection import non_max_supression
except Exception as exc
print(exc)
I've read in a lot of places that this can be a problem with FreeType library, so I've tried to uninstall, then tested and then installed again, tested again, but nothing changes. Some places says that it's a problem with infinality bundle, but I haven't installed that.
Related
I followed the instructions and successfully installed pypostal python package (package to help parse addresses) https://github.com/openvenues/pypostal.
I'm trying to set this up so the python script can be callable through an apache server on an ubuntu box. It works fine when executing the script from Terminal. However, it doesn't work when I make a call to apache to execute the script and I get the following error in the apache logs. I believe it might be some pathing issue but I haven't had much luck to resolve it. Any ideas will be appreciated.
Error:
File "/var/www/html/cgi-bin/get_parsedAddress.py", line 5, in
from postal.parser import parse_address
ModuleNotFoundError: No module named 'postal'
python script contents:
import sys
from postal.parser import parse_address
addressList = parse_address(sys.argv[1])
print(addressList)
I am using Pillow-6.1.0 for my python project and I am trying to import the ImageGrab() function inside it however I keep getting this following error:
cannot import name '_imaging' from 'PIL'
I am currently using Python 3.7 and editing the code on Visual Studios (Unsure if the IDE may play part in the error as I do not have much experience on it)
I am also running Windows so some of the solutions I have seen which require Linux does not work for me.
What I have tried:
Uninstalling and reinstalling Pillow
Deleting everything with "PIL" in the Python37-32/Lib/site-packages folder and uninstalling Pillow and reinstalling
Moving the Pillow module directly into my project folder
Moving ImageGrab.py directly into my project folder
Updated my Pillow module
All my reinstallations of Pillow is via the pip command
Other possibly relevant info:
ImageGrab() is not the only module that I cant import, I also cant import the Image module
I can import the PIL module successfully but I cannot access the modules within it via the command "from PIL import some_PIL_module" in my IDE
I only get the "cannot import name '_imaging' from 'PIL'" error when I am running my code through the Visual Studios IDE, if I type the command "from PIL import ImageGrab" directly into the python terminal it runs successfully with no errors
This is the line that gives me the error in my code
from PIL import ImageGrab;
I expected it to import with no problems but instead, I get the following error:
cannot import name '_imaging' from 'PIL'
I'm trying to bruteforce (a rootme challenge don't worry :p) an SNMPv3 authentication password using this python script : https://github.com/cysboy/SnmpCrack/blob/master/SnmpCrack.py
Nevertheless, I have an error loading a scapy snmp module line 72 on this code
snmp = pkt[SNMP]
I printed the error by adding
except Exception as e :
print("Continuing")
print(e)
continue
In the followed try catch.
I get this error : Layer [<class 'scapy.layers.snmp.SNMP'>] not found
So I tried to search where this class should have been declared.
I found a file under /usr/lib/python2.7/dist-packages/scapy/layers/snmp.py where the class is defined.
I tried to import this file manually and other modules with
import sys
sys.path.insert(0, "/usr/lib/python2.7/dist-packages/scapy/layers/")
import snmp
from scapy.all import *
from scapy.layers import *
from scapy.layers.snmp import * #SNMP, SNMPresponse, SNMPvarbind
But I don't really know what I'm doing exactly.
Is there a way to be sure this file is included as a scapy submodule / class ?
I'm running under the latest Kali 64 bit. I tried with python3 aswell without success.
I'm running this script with python 2.7.14+
Thanks if you can help me with that :)
Have a good day
Quite old question already.
As you can see in the code source,
https://github.com/secdev/scapy/blob/master/scapy/layers/snmp.py
the fields do exist in recent versions.
Try uninstalling scapy from apt, and install it via github or via
pip install scapy
It may be a problem of versioning...
First the setup: Windows 8.1 64bit, Python 3.4 32bit.
I wanted to run the code here. So I installed comtypes
pip install comtypes
I then tried to run the code, i got
ImportError: cannot import name 'SpeechLib'
Then tried this code here to try and generate the needed SpeechLib module.
I am however still getting the same error, what should I try next?
Running these lines made it work:
from comtypes.client import CreateObject
engine = CreateObject("SAPI.SpVoice")
stream = CreateObject("SAPI.SpFileStream")
Output was:
# Generating comtypes.gen._C866CA3A_32F7_11D2_9602_00C04F8EE628_0_5_4
# Generating comtypes.gen.SpeechLib
After this I got no import error anymore, as expected.
I am trying to set up IBPY and Python on my Mac to run with Interactive Brokers. I have installed Git. I created a subdirectory ibapi under Home. I downloaded IBPy using git clone https://github.com/blampe/IbPy from the ibapi directory.
I am now trying to run the Demo.py program in Spyder. When I choose Run, I receive the error message:
ImportError: No module named Ib.Message
The first few lines of the demo program are:
import os
import sys
import time
import Ib.Message
import Ib.Socket
import Ib.Type
I am also trying to run a sample program: ib_api_demo from http://www.quantstart.com/articles/Using-Python-IBPy-and-the-Interactive-Brokers-API-to-Automate-Trades. When I try to run this, I get the error message:
ImportError: No module named ib.ext.Contract
The first few lines are:
from ib.ext.Contract import Contract
from ib.ext.Order import Order
from ib.opt import Connection, message
I figured this out. The problem was I was launching Spyder from my Mac Finder. When I did this, I received the error messages. When I launched Spyder (actually Anaconda Python) by typing "Spyder" in the Terminal window, this launched Anaconda Python. From here, I could run all my programs successfully with no errors.