I am trying to setup PyGears, I have installed the package using pip. I am trying to execute the bellow two lines of code using command line.
from pygears import gear, Intf
from pygears.typing import Uint
This is the error I received:
Traceback (most recent call last):
File "test.py", line 1, in <module>
from pygears import gear, Intf
File "C:\Users\Nikola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pygears\__init__.py", line 15, in <module>
import pygears.typing
File "C:\Users\Nikola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pygears\typing\__init__.py", line 1, in <module>
from pygears.conf import PluginBase, reg
File "C:\Users\Nikola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pygears\conf\__init__.py", line 5, in <module>
from .trace import pygears_excepthook, register_issue, MultiAlternativeError
File "C:\Users\Nikola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pygears\conf\trace.py", line 400, in <module>
elif PYPY:
NameError: name 'PYPY' is not defined
To my understanding, PyPy is an alternative interpreter to CPython, but I am unsure whether the symbol mentioned above is related to this. Should I try configuring PyPy as my interpreter or is this issue caused by something else?
Thank you in advance
Update: this has been fixed by https://github.com/bogdanvuk/pygears/commit/a27df7ce62cfe568978fad1f39d87372b5b9a531
This looks like a bug in pygears. If you try with python >= 3.7, you should not run into this error.
I submitted a bug report: https://github.com/bogdanvuk/pygears/issues/8
Related
I have been trying to code the display on my Ableton push 2 with python using this guide: github.com/ffont/push2-python#using-the-simulator, but I ran into a problem with pyusb and i was missing libusb. pip3 kept saying I already had it installed but I still kept getting errors when trying to use Libusb. So i tried using homebrew and it installed it but I still keep getting errors when using libusb.
this is what my terminal looks like when trying to import:
>>> import libusb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/libusb/__init__.py", line 7, in <module>
from ._libusb import * ; del _libusb # noqa
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/libusb/_libusb.py", line 29, in <module>
from ._platform import CFUNC
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/libusb/_platform/__init__.py", line 33, in <module>
from ._osx import DLL_PATH, DLL, dlclose, CFUNC
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/libusb/_platform/_osx/__init__.py", line 14, in <module>
raise NotImplementedError("This OS is not supported yet!")
NotImplementedError: This OS is not supported yet!
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'm a beginner in OpenGL/OpenCL.
I'm trying to execute code from this
example, but there is an error:
Traceback (most recent call last):
File "/home/anka-rybalko/workspace/bla/openGL.py", line 99, in initializeGL
self.initialize_buffers()
File "/home/anka-rybalko/workspace/bla/openGL.py", line 61, in initialize_buffers
self.ctx, self.queue = clinit()
File "/home/anka-rybalko/workspace/bla/openGL.py", line 37, in clinit
+ get_gl_sharing_context_properties())
File "/usr/lib64/python2.7/site-packages/pyopencl-2014.1-py2.7-linux-x86_64.egg/pyopencl/tools.py", line 422, in get_gl_sharing_context_properties
from OpenGL import platform as gl_platform, GLX, WGL
File "/usr/lib/python2.7/site-packages/OpenGL/WGL/__init__.py", line 1, in <module>
from OpenGL.raw.WGL.VERSION.WGL_1_0 import *
File "/usr/lib/python2.7/site-packages/OpenGL/raw/WGL/VERSION/WGL_1_0.py", line 48, in <module>
#_p.types(_cs.c_int,_cs.HDC,ctypes.POINTER(_cs.PIXELFORMATDESCRIPTOR))
File "/usr/lib/python2.7/site-packages/OpenGL/raw/WGL/VERSION/WGL_1_0.py", line 13, in _f
return _p.createFunction( function,_p.PLATFORM.WGL,'WGL_VERSION_WGL_1_0',error_checker=_errors._error_checker)
AttributeError: 'GLXPlatform' object has no attribute 'WGL'
As I understand, WGL is an API for Windows OS and not for Linux. Should I somehow specify my platform before? Or how can I fix this?
Thanks in advance!
The code you are using (PyOpenGL 2014.1) is importing two platform-specific modules (WGL and GLX). PyOpenGL should have raised that error as an ImportError (rather than the AttributeError), but it still would have failed.
PyOpenCL has, in the meantime, worked around the issue in their github repository. If you have git installed (and pip) then this should get you a new version (note: not set up for OpenCL development here, so can't actually test this):
pip install git+https://github.com/pyopencl/pyopencl#egg=pyopencl
Maybe someone has a clue about this one. Google, the Logilab.org archives and every other source I tried to determine a solution have turned up empty.
I was trying to get Pylint 2.4 running with PyDev in Eclipse (with Python 2.6) on Windows, but right now I'd be happy simply running pylin at all. I used easy_install to install pylint and it's dependancies. That seemed to work fine. However if I try to run c:\python26\Scripts\pylint.bat , I get the following:
Traceback (most recent call last):
File "C:\Python26\Scripts\pylint", line 5, in <module>
pkg_resources.run_script('pylint==0.24.0', 'pylint')
File "c:\Python26\lib\site-packages\pkg_resources.py", line 489, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "c:\Python26\lib\site-packages\pkg_resources.py", line 1207, in run_script
execfile(script_filename, namespace, namespace)
File "c:\python26\lib\site-packages\pylint-0.24.0-py2.6.egg\EGGINFO\scripts\pylint", line 3, in <module>
from pylint import lint
File "c:\Python26\lib\site-packages\pylint-0.24.0-py2.6.egg\pylint\lint.py", line 31, in <module>
from pylint.checkers import utils
File "c:\Python26\lib\site-packages\pylint-0.24.0py2.6.egg\pylint\checkers\__init__.py", line 44, in <module>
from logilab.astng.utils import ASTWalker
File "c:\Python26\lib\site-packages\logilab_astng-0.22.0py2.6.egg\logilab\astng\__init__.py", line 58, in <module>
from logilab.astng.nodes import *
File "c:\Python26\lib\site-packages\logilab_astng-0.22.0-py2.6.egg\logilab\astng\nodes.py", line 54, in <module>
from logilab.astng.node_classes import Arguments, AssAttr, Assert, Assign, \
File "c:\Python26\lib\site-packages\logilab_astng-0.22.0-py2.6.egg\logilab\astng\node_classes.py", line 27, in <module>
from logilab.astng.bases import (NodeNG, Statement, Instance, InferenceContext,
File "c:\Python26\lib\site-packages\logilab_astng-0.22.0-py2.6.egg\logilab\astng\bases.py", line 28, in <module>
from logilab.common.compat import builtins
ImportError: cannot import name builtins
I mucked around and looked into based.py, but I have no clue what the problem is. My shell path includes C:\python26;c:\Python26\Scripts.
Does this have something to do with lib2to3? Or Python 2.6 compatibility?
Note that I installed pylint using "easy_install pylint", and logilab-common is at the latest 0.56.2.
Thanks!
For me, there is a logilab.common.compat module buried inside the egg "logilab.pylintinstaller-0.15.2-py2.6.egg" in my site-packages folder. Having the logilab_common egg installed, removing the pylintinstaller egg got pylint working in eclipse. I found this out via IPython like so:
In [37]: import logilab.common.compat
In [38]: from logilab.common.compat import builtins
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
C:\Users\Rio\Documents\mcedit\pymclevel\<ipython console> in <module>()
ImportError: cannot import name builtins
In [41]: logilab.common.compat.__file__
Out[41]: 'c:\\python26\\lib\\site-packages\\logilab.pylintinstaller-0.15.2-py2.6.egg\\logilab\\common\\compat.pyc'
Probably you don't have the logilab.common package or the installed version is an old one.
try:
easy_install-2.6 --upgrade logilab-common
I just got Panda3D for the first time. I deleted the included Python version. In my Python dir, I put a file panda.pth that looks like this:
C:\Panda3D-1.6.2
C:\Panda3D-1.6.2\bin
But when I run import direct.directbase.DirectStart, I get:
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import direct.directbase.DirectStart
File "C:\Panda3D-1.6.2\direct\directbase\DirectStart.py", line 3, in <module>
from direct.showbase import ShowBase
File "C:\Panda3D-1.6.2\direct\showbase\ShowBase.py", line 10, in <module>
from pandac.PandaModules import *
File "C:\Panda3D-1.6.2\pandac\PandaModules.py", line 1, in <module>
from libpandaexpressModules import *
File "C:\Panda3D-1.6.2\pandac\libpandaexpressModules.py", line 1, in <module>
from extension_native_helpers import *
File "C:\Panda3D-1.6.2\pandac\extension_native_helpers.py", line 75, in <module>
Dtool_PreloadDLL("libpandaexpress")
File "C:\Panda3D-1.6.2\pandac\extension_native_helpers.py", line 73, in Dtool_PreloadDLL
imp.load_dynamic(module, pathname)
ImportError: Module use of python25.dll conflicts with this version of Python.
I'm assuming this has something to do with me using Python 2.6. Any solutions?
Python extensions aren't binary compatible across major releases. Your options are:
A. Recompile panda3d for python 2.6.
B. Use python 2.5.
No way around it.
If you can wait for the upcoming 1.7.0 release, it will be compiled against Python 2.6 - see this thread.