I have installed imagescanner module on windows following this steps . I have connected to scanner on wifi . When I try this code :
from imagescanner import ImageScanner
iscanner = ImageScanner()
scanners = iscanner.list_scanners()
print(scanners[0])
an error message occured :
C:\Python3.4\python.exe C:/Users/PB/PycharmProjects/ImageScanner/deneme.py
Traceback (most recent call last):
File "C:/Users/PB/PycharmProjects/ImageScanner/deneme.py", line 4, in <module>
from imagescanner import ImageScanner
File "C:\Python3.4\lib\site-packages\imagescanner-0.9-py3.4.egg\imagescanner\__init__.py", line 2, in <module>
from imagescanner.core._imagescanner import ImageScanner
File "C:\Python3.4\lib\site-packages\imagescanner-0.9-py3.4.egg\imagescanner\core\_imagescanner.py", line 61
except Exception, exc:
^
SyntaxError: invalid syntax
Process finished with exit code 1
As far as I know, imagescanner isn't compatible with Python 3.
You can try to fix it. The SyntaxError refers to the old syntax for exceptions ("class, variable" become "class as variable" in newer versions). But I'm not sure what other problems you can find.
Related
While importing openai's universe, i get these errors:
Traceback (most recent call last):
File "/Users/calvin/Desktop/universe-test/main.py", line 2, in <module>
import universe
File "/Users/calvin/universe/universe/__init__.py", line 22, in <module>
from universe import error, envs
File "/Users/calvin/universe/universe/envs/__init__.py", line 1, in <module>
import universe.envs.vnc_env
File "/Users/calvin/universe/universe/envs/vnc_env.py", line 11, in <module>
from universe.envs import diagnostics
File "/Users/calvin/universe/universe/envs/diagnostics.py", line 94
async = self.qr_pool.apply_async(self.method, (self._last_img, time.time(), available_at))
^
SyntaxError: invalid syntax
I've tried downloading a different version of gym, reinstalling universe, and nothing works. I have python 3.8.5 64-bit. My operating system is macOS Catalina 10.15.6. Any ideas?
async is now a special keyword, and as such, can't be used as a variable name.
That library appears to be made for Python pre-3.5. I believe your only options are:
Use a older version of Python 3 (async was intrduced in 3.5).
Edit the local copy of the library file to change the name to something else.
Check to see if there are any updates/forks to the library that fix that issue.
I installed pyAudioAnalysis on python2.7 using pycharm (linux). Trying to run audioBasicIO.py gives the following error. I have installed eyeD3 but it does not work.
/usr/bin/python2.7 /usr/local/lib/python2.7/dist-packages/pyAudioAnalysis/audioBasicIO.py
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pyAudioAnalysis/audioBasicIO.py", line 6, in <module>
import eyed3
File "/home/.local/lib/python2.7/site-packages/eyed3/__init__.py", line 31, in <module>
from .utils.log import log # noqa: E402
File "/home/.local/lib/python2.7/site-packages/eyed3/utils/__init__.py", line 361
msg = f"invalid level choice: {level} (choose from {parser.log_levels})"
^
SyntaxError: invalid syntax
Is my installation incorrect? This is the first time I use this library, does anyone have any suggestions.
f-strings aren't supported for python 2.7. You need python 3.6 or above to use them. Here is a good workaround, in which you can use f-strings in below python 3.6.
I'm having an import module issue. I'm using python 3.7.2 on windows 10.
When I trie to import the websockets module (I just write import websockets in the python shell), I have this error :
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Simon\AppData\Local\Programs\Python\Python37-32\lib\site-packages\websockets\__init__.py", line 16, in <module>
+ uri.__all__
NameError: name 'client' is not defined
I tried to download the websockets module last version but the error remains.
PS : English is not my native language, sorry for the phrasing
I am running a python code using python3.7 in Ubuntu 18.10.
The code requires use of aux module of python.
So, I installed the aux python module.
After that if I run the code it shows the following error,
Traceback (most recent call last):
File "models.py", line 5, in <module>
from aux.ptb_aux import *
File "/home/rstudio/anaconda3/lib/python3.7/site-packages/aux/__init__.py", line 40
except Exception, e:
^
SyntaxError: invalid syntax
Can anyone please tell me what might be the source of error and the possible solution.
Thanks in advance.
Getting this error when running pip install -U selenium. Mid way through the script, it gets the following SyntaxError:
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "C:\Python32\Scripts\build\rdflib\setup.py", line 6, in <module>
from rdflib import __version__
File "rdflib\__init__.py", line 64, in <module>
from rdflib.term import URIRef, BNode, Literal, Variable
File "rdflib\term.py", line 367
except TypeError, te:
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "C:\Python32\Scripts\build\rdflib\setup.py", line 6, in <module>
from rdflib import __version__
File "rdflib\__init__.py", line 64, in <module>
from rdflib.term import URIRef, BNode, Literal, Variable
File "rdflib\term.py", line 367
except TypeError, te:
^
SyntaxError: invalid syntax
----------------------------------------
Command python setup.py egg_info failed with error code 1
Since it is a Syntax Error, I assume it is a python version problem, I'm running 3.2.2.
Pip did come with a pip-3.2.exe file, which I tried to run. But I got the same error. I'm pretty new to Python so it might be something simple.
And how can it be a syntaxError? pip is an already made program.
Running Win7, Python 3.2.2
Selenium does not support Python 3. Use Python 2.7 instead.
Sadly, almost all Python software requires Python 2.x.
[Update]
Selenium supports Python 3.x now.