Hello. Newbie learning from McWhorters tutorials. Time install Servokit but get: SyntaxError: from __future__ feature annotations

djl@djl-desktop:~$ sudo -H pip3 install adafruit-circuitpython-servokit==1.2.1
Collecting adafruit-circuitpython-servokit==1.2.1
Using cached https://files.pythonhosted.org/packages/3f/27/7c490ca70307620eb39f279f2244ef55c77eb6680260cd5626a429183b9e/adafruit-circuitpython-servokit-1.2.1.tar.gz
Complete output from command python setup.py egg_info:
/usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: ‘long_description_content_type’
warnings.warn(msg)
Traceback (most recent call last):
File “”, line 1, in
File “/tmp/pip-build-3sovcjkv/adafruit-circuitpython-servokit/setup.py”, line 59, in
py_modules=[“adafruit_servokit”],
File “/usr/lib/python3/dist-packages/setuptools/init.py”, line 129, in setup
return distutils.core.setup(**attrs)
File “/usr/lib/python3.6/distutils/core.py”, line 108, in setup
_setup_distribution = dist = klass(attrs)
File “/usr/lib/python3/dist-packages/setuptools/dist.py”, line 372, in init
_Distribution.init(self, attrs)
File “/usr/lib/python3.6/distutils/dist.py”, line 281, in init
self.finalize_options()
File “/usr/lib/python3/dist-packages/setuptools/dist.py”, line 528, in finalize_options
ep.load()(self, ep.name, value)
File “/usr/lib/python3/dist-packages/pkg_resources/init.py”, line 2324, in load
return self.resolve()
File “/usr/lib/python3/dist-packages/pkg_resources/init.py”, line 2330, in resolve
module = import(self.module_name, fromlist=[‘name’], level=0)
File “/tmp/pip-build-3sovcjkv/adafruit-circuitpython-servokit/.eggs/setuptools_scm-7.0.5-py3.6.egg/setuptools_scm/init.py”, line 5
from future import annotations
^
SyntaxError: future feature annotations is not defined

----------------------------------------

Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-3sovcjkv/adafruit-circuitpython-servokit/

As I referenced, I’m a newbie to programming so to deep I’ll drown at this point. I have tried to install different servokit versions, from 1.1.0 to 1.3.10 to no avail. Does anyone have any suggestions to the anomaly above? Have even gone as far as to flash my SD with JP422 but the error is the same. Thanks in advance.

Hi @djlevstik. I don’t think this is the right forum for this question. This is forum is related to NVIDIA Omniverse.

Thanks Mati, I did warn that I am a Newbie. Do I need to resubmit or just change the forum address?

Thanks

I would suggest search on web for the error first.

I have done that. For the most part it suggests upgrading python to 3.7., any suggestions on how to proceed with that maneuver since this is a pre-loaded image? My Jet Pack is 4.6.2 (L4T 32.7.2) and the python on board is 3.6.9. I have tried earlier versions of jetpack , e.g., 4.2.0, but have had the same outcome. Is there a method to take python up to 3.7 or higher that is compatible with the b01 architecture? Other online suggestions lean toward using a virtual environment? I chose to come to the forums with this issue, as I have seen others with this error and was hopeful that there was a Nvidia fix to it, since it is in the image; and, for a newbie like me, going into the source code is way over my head just to make servos work for object tracking.

hi @djlevstik, I think that solution is described here: From adafruit_servokit_ import ServoKit. PCA9685
You should know that all of Paul’s examples are based on Jetpack Version ~4.2 so it might be hard to use them now without any modifications!

@ w1ngedshadow:
Out of frustration, I blindly used the code supplied as example from @naisy’s post, it resulted in the same future error. I’m not done though and will continue to look for the right combination to downgrade. Any suggestions to discover where the libraries are listed, so I can root out the culprit? Thanks for your post.
Edit, error flagged out of the: Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-0mbug1de/adafruit-circuitpython-busdevice/

Adafruit libraries are updated frequently, Downgrade the library to find a version that works.

sudo pip3 install -U
adafruit-circuitpython-busdevice==5.1.2
adafruit-circuitpython-motor==3.3.5
adafruit-circuitpython-pca9685==3.4.1
adafruit-circuitpython-register==1.9.8
adafruit-circuitpython-servokit==1.3.8
Adafruit-Blinka==6.11.1
Adafruit-GPIO==1.0.3
Adafruit-MotorHAT==1.4.0
Adafruit-PlatformDetect==3.19.6
Adafruit-PureIO==1.1.9
Adafruit-SSD1306==1.6.2

@Steven-code-25

Yes. I followed the direction from @naisy’s response in @w1ngedshadow above response to which is your response, I still received the Syntax Error: future annotations not defined. I am investigating what other older numbers to try to downgrade too. Is there a list of previous versions available to utilize in this endeavor? Is there a way to call up these versions through the terminal, or is it out on the internet?

Thanks for your response

hello friend, run the " pip freeze " command in the terminal, there you can see what libraries you have installed and what are the versions of the installed libraries.
Remember that with the command " sudo pip3 uninstall " XXX you can uninstall libraries that you have installed.

I hope this helps you in some way and you manage to solve the problem soon.

Thanks for the direction @Steven-code-25. @naisy, @w1ngedshadow , @mati-nvidia . After contemplation, I determined that the issue was not needing to go back but forward; reason- future annotations “NOT DEFINED”, so then, let’s define them. In this instance I have learned__future__ is a module that Python uses, so I installed it: :~$ python3 -m pip install future , and then upgraded it to as high as it could go on JP 4.6.2, to 0.18.2. Additionally, after reading through pythons documents, it was found that the system may need an upgrade of the setuptools module, so I updated it :~$ python3 -m pip install --upgrade pip setuptools wheel, this took pip to (21.3.1), setuptools to (59.6.0) and wheel to (0.37.1), it appears progress is being made.

With those two modules installed and upgraded, I was finally able to install Adafruit-Crcuitpython-Servokit without annotations error. Yeah. But next came another issue; the original syntax error now appears in the terminal of VS-Code and my program doesn’t leave the ground. Reading through the pydoc of future, it does not list annotations, it is not part of 0.18.2, hence the error future annotations not defined. So much for defining, huh? Well… I was successful in moving the error and determining that it is a Python issue. Unfortunately, when installing PIP3 on my unit, that installation takes py-3.6.8 to 3.6.9 where I believe this error begins to raise its head, as this error did not show during the tutorials by P. McWhorter, so by inference the problem is in python 3.6.9.

My next step was to upgrade python on the Nano to 3.7.5 as annotations was supposedly part of this version, but I did not update-alternatives because when 3.7.5 is used, opencv does not work, it cannot be found. So, I used the Python Interpreter Selector in VS-Code to run the program, now the error changes to: from adafruit_servokit import ServoKit ModuleNotFoundError: No module named 'adafruit_servokit. Well ain’t that fun?

So now on to the next great adventure, I am pursing how to possibly downgrade my python to 3.6.8 and hold it there, as long as the pip installation does not upgrade python. Why 3.6.8? While closely watching the before mentioned tutorial, during Paul’s 2020 upgrade installation of JP-4.3, python 3.6.8 was the version being used. Any thoughts? Is there a way to prevent python from upgrading to 3.6.9 when installing PIP, where it seems the issue comes from: Even though PIP is still needed for module installation? Well, I believe I have come to the end of this discussion, since the problem has been resolved, but now has exposed the real issue, that of it being in the python source code, do I close this out now?

Thanks to all for the support.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.