I am trying to install python-3.5.1 on mipsel. Initially while doing 'make' it gave me syntax error in graminit file, so i gave it the path of graminit.h of another python-3.5.1 (which was compiled for ubuntu 14.04 or say x86 platform).Later same happened for my importlib module (again i did the same).And now it is giving me syntax invalid as:-
Failed to import the site module
Traceback (most recent call last):
File "./Lib/site.py", line 72, in <module>
import os
File "./Lib/os.py", line 666, in <module>
from _collections_abc import MutableMapping
File "./Lib/_collections_abc.py", line 56
async def _coro(): pass
^
SyntaxError: invalid syntax
make: *** [sharedmods] Error 1
Related
i use conda created a new python 3.6 environment, then i use instructions like pip or python it comes out the same error:
(mypy36) C:\Users\admin>python
Fatal Python error: Py_Initialize: can't initialize sys standard streams
Traceback (most recent call last):
File "D:\anaconda\lib\abc.py", line 64, in <module>
ModuleNotFoundError: No module named '_abc'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\anaconda\lib\io.py", line 52, in <module>
File "D:\anaconda\lib\abc.py", line 68, in <module>
File "D:\anaconda\lib\_py_abc.py", line 35
def __new__(mcls, name, bases, namespace, /, **kwargs):
^
SyntaxError: invalid syntax
(mypy36) C:\Users\admin>conda list -n mypy36 python
# packages in environment at D:\anaconda\envs\mypy36:
#
# Name Version Build Channel
python 3.6.2 0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
(mypy36) C:\Users\admin>python -V
Python 3.6.2 :: Continuum Analytics, Inc.
i have tried set PATHONPATH="", it doesn't work.
can anyone help?
My python code for a reinforcement task cannot render when I run it in docker. I tried installing GL when I got the import error but it still gives me the same error. Is there ay other way to fix this without messing with package managers?
Error message:
/usr/local/lib/python3.7/site-packages/gym/logger.py:30: UserWarning: WARN: Box bound precision lowered by casting to float32
warnings.warn(colorize('%s: %s'%('WARN', msg % args), 'yellow'))
Episode 0
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/lbforaging/foraging/rendering.py", line 33, in <module>
from pyglet.gl import *
File "/usr/local/lib/python3.7/site-packages/pyglet/gl/__init__.py", line 95, in <module>
from pyglet.gl.lib import GLException
File "/usr/local/lib/python3.7/site-packages/pyglet/gl/lib.py", line 149, in <module>
from pyglet.gl.lib_glx import link_GL, link_GLU, link_GLX
File "/usr/local/lib/python3.7/site-packages/pyglet/gl/lib_glx.py", line 45, in <module>
gl_lib = pyglet.lib.load_library('GL')
File "/usr/local/lib/python3.7/site-packages/pyglet/lib.py", line 164, in load_library
raise ImportError('Library "%s" not found.' % names[0])
ImportError: Library "GL" not found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "if.py", line 106, in <module>
env.render()
File "/usr/local/lib/python3.7/site-packages/lbforaging/foraging/environment.py", line 501, in render
self._init_render()
File "/usr/local/lib/python3.7/site-packages/lbforaging/foraging/environment.py", line 494, in
_init_render
from .rendering import Viewer
File "/usr/local/lib/python3.7/site-packages/lbforaging/foraging/rendering.py", line 41, in <module>
"""
ImportError:
Error occured while running `from pyglet.gl import *`
HINT: make sure you have OpenGL install. On Ubuntu, you can run 'apt-get install python-opengl'.
If you're running on a server, you may need a virtual frame buffer; something like this should work:
'xvfb-run -s "-screen 0 1400x900x24" python <your_script.py>'
pip3 install GL says requirement already satisfied and gives the same error "GL not found"
and pip3 install OpenGL gives:
ERROR: Could not find a version that satisfies the requirement OpenGL
ERROR: No matching distribution found for OpenGL
You need an older version of pyglet; Installing it via pip should do the trick:
pip install pyglet==1.5.11
Further discussion here:
https://github.com/openai/gym/issues/2101
I wanted to create a virtualenv for python 2.7 (I'm using 3.7)
I run the cmd as admin (on windows 10) :
C:\WINDOWS\system32>virtualenv -p C:\Python27\python.exe py27
An I got the error:
Running virtualenv with interpreter C:\Python27\python.exe
Traceback (most recent call last):
File "c:\path\to\virtualenv.py", line 26, in <module>
import logging
File "C:\Python27\lib\logging\__init__.py", line 43, in <module>
import threading
File "C:\Python27\lib\threading.py", line 15, in <module>
from collections import deque
File "C:\Python27\lib\collections\__init__.py", line 55
raise AttributeError(f'module {__name__!r} has no attribute {name!r}')
^
SyntaxError: invalid syntax
When I Launch Python2.7 and try to import the logging module: It show the same error but When I retype it. It work just fine:
>>> import logging
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\logging\__init__.py", line 43, in <module>
import threading
File "C:\Python27\lib\threading.py", line 15, in <module>
from collections import deque
File "C:\Python27\lib\collections\__init__.py", line 55
raise AttributeError(f'module {__name__!r} has no attribute {name!r}')
^
SyntaxError: invalid syntax
>>> import logging
>>> logging.warning('hello word')
WARNING:root:hello word
>>>
I can't figure out why it does that.
I have already configured a virtual env with python 3.6
Any help would be appreciated.
You have a version problem. This line
raise AttributeError(f'module {__name__!r} has no attribute {name!r}')
is being run under Python 2.7, but is Python 3.6 (or 3.7) and will give you a syntax error in earlier versions. In your case I would treat that Python 2.7 installation as irretrievably broken, because it is clear that the standard library isn't to be trusted to all be of a consistent version.
The problem was resolved deleting the c:\Python27 directory, Then Uninstalling python 2.7 using the setup tool, restarting the computer and reinstalling Python 2.7
I use python3.5, i recently installed spamc using pip.
When i try to import spamc, an error is raised:
How can i resolve this error?Should i find and install other library where spamc is included in it?
import spamc
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
import spamc
File "/usr/local/lib/python3.5/dist-packages/spamc/__init__.py", line 24, in <module>
from spamc.client import SpamC
File "/usr/local/lib/python3.5/dist-packages/spamc/client.py", line 230
except socket.gaierror, err:
^
SyntaxError: invalid syntax
I just installed Python 3.3 and then I tried to install rauth by issuing the command:
pip install rauth
and I get this error:
Downloading/unpacking rauth
Running setup.py egg_info for package rauth
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "c:\users\pipul\appdata\local\temp\pip-build-pipul\rauth\setup.py", l
ine 4, in <module>
from rauth import __version__
File ".\rauth\__init__.py", line 30, in <module>
from .service import OAuth1Service, OAuth2Service, OflyService
File ".\rauth\service.py", line 23
except KeyError, e: # pragma: no cover
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "c:\users\pipul\appdata\local\temp\pip-build-pipul\rauth\setup.py", line 4, in <module>
from rauth import __version__
File ".\rauth\__init__.py", line 30, in <module>
from .service import OAuth1Service, OAuth2Service, OflyService
File ".\rauth\service.py", line 23
except KeyError, e: # pragma: no cover
^
SyntaxError: invalid syntax
----------------------------------------
Command python setup.py egg_info failed with error code 1 in c:\users\pipul\appd
ata\local\temp\pip-build-pipul\rauth
Storing complete log in C:\Users\pipul\pip\pip.log
## Heading ##c:\Python33\Scripts>
Similarly installing oauth2 also fails. But installing selenium succeeds.
Now what could be the thing that is causing this failure?
Thanks in advance.
Like many packages, rauth currently does not support Python 3. However, it looks like there is a branch where they are working on it. See here.
In general, you may have more luck installing packages if you use Python 2.7.