Trigger (Networktest) installation on Python 3.7 - python

Currently I have the problem that I get the following error message under Python 3.7 when installing the package trigger (network test for router / switch).
If you try to install the offending package separately, then you get the same error message.
Collecting gtextfsm (from trigger)
Using cached https://files.pythonhosted.org/packages/98/12/edfdccf3d968ffbb94ac8e48b3172395b6902eb4265bded0b0d07a1652f3/gtextfsm-0.2.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\xxxxxx\AppData\Local\Temp\pip-install-4_suoa4z\gtextfsm\setup.py", line 19, in <module>
import textfsm
File "C:\Users\xxxxxx\AppData\Local\Temp\pip-install-4_suoa4z\gtextfsm\textfsm\__init__.py", line 2, in <module>
__version__ = textfsm.__version__
NameError: name 'textfsm' is not defined-
Is there another alternative to triggers?
Did someone have the problem described above?
Other solutions?

Related

ImportError: No module named django_auth_ldap

I can't seem to get python ldap libraries to work properly with Django:
>>> from django_auth_ldap import *
Traceback (most recent call last):
File "<console>", line 1, in <module>
ImportError: No module named django_auth_ldap
I'm running Ubuntu v14.
This is what a pip freeze looks like on my working environment:
Django==1.9.4
django-auth-ldap==1.2.7
django-filter==0.13.0
djangorestframework==3.3.3
Markdown==2.6.5
pyasn1==0.1.9
pyldap==2.4.25.1
python3-ldap==0.9.8.4
(I installed ldap for python3 as well to do a sanity check)
But as I go through all the guides here, they all seem to point to the same libraries I already have except for "pip install python-ldap".
When I try to do:
pip install python-ldap
I just get the following result:
Collecting python-ldap
Using cached python-ldap-2.4.25.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-0c5p7fkj/python-ldap/setup.py", line 53
print name + ': ' + cfg.get('_ldap', name)
^
SyntaxError: invalid syntax
----------------------------------------
Does anyone know what are the best steps I should take to get around this issue to get the library working?
I've tried doing a wget for
https://pypi.python.org/pypi/python-ldap
And I extracted the files and simply used
python setup.py install to the tar ball, but to no avail.
Any suggestions?
Found the solution from this page:
https://www.howtoinstall.co/en/ubuntu/precise/universe/python-django-auth-ldap/
The following command seems to have done the trick:
apt-get install python-django-auth-ldap

Unable to install IBM_DB in Raspberry PI

I'm trying to install ibm_db on my raspberry pi with raspbian. I've been trying with many methods but non one has worked, I always get this output :
root#raspberrypi:/home/pi# pip2 install ibm_db
Downloading/unpacking ibm-db
Downloading ibm_db-2.0.6.tar.gz (552kB): 552kB downloaded
Running setup.py (path:/tmp/pip-build-nzFdb7/ibm-db/setup.py) egg_info for package ibm-db
Detected 32-bit Python
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip-build-nzFdb7/ibm-db/setup.py", line 149, in <module>
easy_cli_path = os.path.join(tmp_path, 'ibm_db-%s.egg' % ("-".join([VERSION, "py"+sys.version.split(" ")[0][0:3]]) if('win32' in sys.platform) else "-".join([VERSION, "py"+sys.version.split(" ")[0][0:3], os_, arch_])), 'clidriver')
NameError: name 'arch_' is not defined
Complete output from command python setup.py egg_info:
Detected 32-bit Python
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip-build-nzFdb7/ibm-db/setup.py", line 149, in <module>
easy_cli_path = os.path.join(tmp_path, 'ibm_db-%s.egg' % ("-".join([VERSION, "py"+sys.version.split(" ")[0][0:3]]) if('win32' in sys.platform) else "-".join([VERSION, "py"+sys.version.split(" ")[0][0:3], os_, arch_])), 'clidriver')
NameError: name 'arch_' is not defined
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-nzFdb7/ibm-db
Storing debug log for failure in /root/.pip/pip.log
Can anybody help me or give me an advice?
I'm getting frustated!
Thanks in advance.

mysql-connector-python is not supported in python3.2?

I've tried installing mysql-connector python using
pip install mysql-connector-python
and
pip install mysql-connector-python --allow-external mysql-connector-python
I get the following error saying python v3.2 is not supported.
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/home/wolfgang/projects/python/python_backend/build/mysql-connector-python/setup.py", line 41, in <module>
import setupinfo
File "setupinfo.py", line 37, in <module>
major=sys.version_info[0], minor=sys.version_info[1]
RuntimeError: Python v3.2 is not supported
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/home/wolfgang/projects/python/python_backend/build/mysql-connector-python/setup.py", line 41, in <module>
import setupinfo
File "setupinfo.py", line 37, in <module>
major=sys.version_info[0], minor=sys.version_info[1]
RuntimeError: Python v3.2 is not supported
----------------------------------------
Should i upgrade my python version? or is there a workaround?
There were some important improvement in 2.x compatibility in Python 3.3, so a lot of packages only support 3.3+. mysql-connector-python is one of them. You are unlikely to be able to fix it without a large amount of work. It would be much easier to just install a later version.

Adding Python Modules on A2hosting Web Server

I am a newb so sorry in advance.
Background: I am currently using A2hosting as my web server. I have python on the web server (obviously), that I use to dynamically update my website by a cronjob. Now, I would like to make plots of stuff and add them to my website using the Python module matplotlib. I currently, do not have that module on the webserver, or at least I am getting the error that no module exists.
Question: So how do I add a Python module when I have SSH'd into my A2hosting webserver? I tried using sudo apt get but did not work.
My Error Message:
roy123#reichwein.net [~]# pip install numpy
Downloading/unpacking numpy
Downloading numpy-1.8.0.tar.gz (3.8Mb): 3.8Mb downloaded
Running setup.py egg_info for package numpy
Traceback (most recent call last):
File "<string>", line 14, in ?
File "/home/roy123/build/numpy/setup.py", line 16
from __future__ import division, print_function
SyntaxError: future feature print_function is not defined
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in ?
File "/home/roy123/build/numpy/setup.py", line 16
from __future__ import division, print_function
SyntaxError: future feature print_function is not defined
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /home/roy123/build/numpy
Storing complete log in /home/roy123/.pip/pip.log
Thanks!

Error packaging a python application to make it pip-installable

I am new to git, and deployed my first python-django app via github:
https://github.com/staticdev/django-crud-utils
The problem is that, when I try to install it, I get the error:
$ pip install -e git://github.com/staticdev/django-crud-utils.git#egg=django-crud-utils
Obtaining django-crud-utils from git+git://github.com/staticdev/django-crud-utils.git#egg=django-crud-utils
Updating /home/static/virtualenvs/prp2/src/django-crud-utils clone
Running setup.py egg_info for package django-crud-utils
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/static/virtualenvs/prp2/src/django-crud-utils/setup.py", line 15, in <module>
DESC = " ".join(__import__('crud_utils').__doc__.splitlines()).strip()
AttributeError: 'NoneType' object has no attribute 'splitlines'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/static/virtualenvs/prp2/src/django-crud-utils/setup.py", line 15, in <module>
DESC = " ".join(__import__('crud_utils').__doc__.splitlines()).strip()
AttributeError: 'NoneType' object has no attribute 'splitlines'
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /home/static/virtualenvs/prp2/src/django-crud-utils
Storing complete log in /home/static/.pip/pip.log
Any help?
Tks in advance.
You don't have a docstring on the crud_utils package, thus installation fails.
You can get the same error by just running the setup.py module locally:
python setup.py
Add a docstring to your crud_utils/__init__.py module:
"""Some docstring here would help"""
P.S. You also checked in the .pyc byte-compiled cache files into GitHub, you may want to remove those.

Categories

Resources