Comments (8)
Ok, I've removed packages (pyModeS*) from .local dir (in home from user) and from /usr/local/lib/python3.5/dist-packages/.
Done install again.....still same problem, with different path:
pi@rasp3_dev:~/pyModeS $ modeslive --help
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/pyModeS-2.8-py3.5.egg/pyModeS/__init__.py", line 5, in <module>
from . import c_common as common
ImportError: cannot import name 'c_common'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/modeslive", line 4, in <module>
__import__('pkg_resources').run_script('pyModeS==2.8', 'modeslive')
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 739, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1494, in run_script
exec(code, namespace, namespace)
File "/usr/local/lib/python3.5/dist-packages/pyModeS-2.8-py3.5.egg/EGG-INFO/scripts/modeslive", line 10, in <module>
from pyModeS.streamer.decode import Decode
File "/usr/local/lib/python3.5/dist-packages/pyModeS-2.8-py3.5.egg/pyModeS/__init__.py", line 8, in <module>
from . import py_common as common
File "/usr/local/lib/python3.5/dist-packages/pyModeS-2.8-py3.5.egg/pyModeS/py_common.py", line 130
addr: Optional[str]
^
SyntaxError: invalid syntax
from pymodes.
Hello @jmceara.
Try removing and installing all again with pip: pip3 remove pyModeS
and pip3 install pyModeS
.
If the error is still there, make sure that in the module directory /usr/local/lib/python3.5/dist-packages/pyModeS exists the files c_common.pxd and c_common.pyx
from pymodes.
@jmceara, @imanolpg, (and @xoolive FYI)
I did some tests with different Python versions. The error is caused by variable annotation (PEP 526) in the py_common
module. It only effects Python version 3.5 and below.
So, the simplest option is to update you Python to 3.6+ for now.
I will evaluate the code to see if we should keep the variable annotation, or make Python 3.6 the minimum required version in the setup.
from pymodes.
Indeed variable annotation syntax is only valid from Python 3.6 (to put things in perspective, Python 3.9rc1 is just out!)
From Python 3.6 we can write
addr: Optional[str] = None
In Python 3.5, the following syntax is valid and should be readable by MyPy (second part to be confirmed...)
addr = None # type: Optional[str]
The first syntax is more flexible but the second should do the job if we just want type hints as information. So yes, in the end @junzis, the only question is when do you want to stop support for Python 3.5
from pymodes.
ok, got it working with version 3.6.12 of python....but I have another problem.
Now I'm getting this error:
File "./jonis.py", line 9, in <module>
if len(msg) > 20 and msg[0:4] == "A000" and pms.bds.bds44.is44(msg) :
AttributeError: module 'pyModeS' has no attribute 'bds'```
But this code is the smae as I was running before.....and also, this is the same code (isbds44) in the main README file. Maybe doc is outdated?
What's the correct way to check now?
from pymodes.
This seems strange. But I can't reproduce this.
Please provide a minimum working example, and the pyModeS version you are using.
from pymodes.
It's exaclty the same code from my first post in this issue, except for the python path that I've changed from #!/usr/bin/python3 -O
to #!/usr/local/bin/python3.6 -O
I'm using python 3.6.12. program modeslive
run fine, without any problem.
Note: Except for the import error in first msg of this topic, the code ran fine in previous version of python (and pyModeS). I mean, before updating pyModeS and python, I was using exactly the same code. I don't remember exactly which version of pyModeS, but it was before BDS4,5 was implemented, if I'm right.....am not sure.
from pymodes.
I think it is a problem with installation.
Maybe try to remove pyModeS use pip uninstall, and then install it again to see if it solves the issue.
If it still doesn't work, try to install and run it the script in a python virtual environment.
If you are struggling with native python library on Linux, the easiest way is to use a python package management tool like anaconda.
from pymodes.
Related Issues (20)
- hdg values not being dumped HOT 1
- Modeslive throws ValueError: ctypes objects containing pointers cannot be pickled HOT 14
- TypeError
- Unused imports HOT 1
- [R82XX] PLL not locked HOT 3
- Incompatible gcc flags on non-AMD64 platforms HOT 4
- Unable to install with Pip on arm64 Ubuntu Server 20 (BananaPi-M5) HOT 6
- Build issues
- IndexError: list index out of range HOT 2
- Coding or comment error HOT 1
- Installation Error on Ubuntu 18.04.6 HOT 3
- Honor option '--help'
- Does Modes or ADSB trasnmits roll angle of the plane?
- ValueError: max() arg is an empty sequence
- ModuleNotFoundError: No module named 'pyModeS.decoder.flarm.decode' HOT 3
- MRAR messages HOT 3
- ModuleNotFoundError: No module named 'pyModeS.decoder.flarm.decode'` HOT 6
- Date and Time
- Python 3.12 pypi package HOT 1
- TCAS RA detection actually uses "TCAS Operational" bit HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pymodes.