ciscoconfparse unable to import python3.7 win10 - python

Any new solution for this. I am unable to from ciscoconfparse import CiscoConfParse
I tried several versions of ciscoconfparse in python3 usin gpowershell in windows10.
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from ciscoconfparse import CiscoConfParse
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python3\lib\site-packages\ciscoconfparse\__init__.py", line 1, in <module>
from .ciscoconfparse import *
File "C:\Python3\lib\site-packages\ciscoconfparse\ciscoconfparse.py", line 4018
^
SyntaxError: invalid syntax
I still have not found a version that will let me import the module.
I browsed through several links here..but did not find an answer. The closest issue to mine is:
ciscoconfparse in Python 3.4 module doesn't import correctly
but not answer.
Any new info?
Thanks

I have reproduced the bug where Win10 and Python 3.7.0 cause problems.
FWIW, if you completely uninstall Python 3.7.0 (including manually deleting your Windows installation directory tree), then install Python 3.7.1, you should not have this problem with Windows 10.

Related

Pybrain not working with Python 3.6.1

I installed Python 3.6.1. And then installed pybrain using git (See Screen Shot). Then when I useimport pybrainit works but afterwards when I usefrom pybrain.tools.shortcuts import buildNetworkit gives me error that: Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import pybrain
>>> from pybrain.tools.shortcuts import buildNetwork
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
from pybrain.tools.shortcuts import buildNetwork
File "C:\Users\davm5\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pybrain\tools\shortcuts.py", line 14
except ImportError, e:
SyntaxError: invalid syntax.
>>> from pybrain.structure import TanhLayer
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
from pybrain.structure import TanhLayer
File "C:\Users\davm5\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pybrain\structure\__init__.py", line 1, in <module>
from connections.__init__ import *
ModuleNotFoundError: No module named 'connections'
Why is it doing like this? Kindly help me out here. Thanks
EDIT: Excluded screen shots. Added everything in post as per request.
except ImportError, e is Python 2 syntax and you've tried to run the code with Python 3. Install the latest version — the code seems to be fixed in git (it's except ImportError as e now, so it's suitable for both Python 2.7 and Python 3).
Just an update: I was able to resolve the issue by un-installing python, then installing python 3.6.2 (64 bit), using pip3 (pip3 install pybrain) I was able to install the latest version of pybrain which worked flawlessly. Thanks to everyone who tried to help me out when I was fairly new to python. Love this community!!

How do I make pandas installed via Anaconda usable by PyCharm?

I'm on Windows 10 and have installed Anaconda3 (2016-1). When I use Spyder that Anaconda installed, import pandas works.
From PyCharm I however can't import pandas. PyCharm is set to use C:\Users\Chris>C:\Users\Chris\Anaconda3\envs\Conda\python.exe.
If I call the exe directly I also can't import pandas despite it being in the Anaconda3 dictionary.
C:\Users\Chris>C:\Users\Chris\Anaconda3\envs\Conda\python.exe
Python 3.5.1 |Continuum Analytics, Inc.| (default, Feb 16 2016, 09:49:46) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'pandas'
What do I have to do, that I can import pandas?
It works when I set the path to C:\Users\Chris>C:\Users\Chris\Anaconda3\python.exe instead of using a virtual enviroment with C:\Users\Chris>C:\Users\Chris\Anaconda3\envs\Conda\python.exe as PyCharm suggests.

matplotlib: no module named compat

I have installed python-2.7.5-5ubuntu3 and matplotlib-1.3.1-1ubuntu5 from the ubuntu 14.04 repository via apt-get. Trying to import the library in python 2.7 raises the following import error:
harold#ubuntu:~$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/share/pyshared/matplotlib/__init__.py", line 157, in <module>
from matplotlib.compat import subprocess
ImportError: No module named compat
>>>
I checked the directory /usr/share/pyshared/matplotlib and, indeed, cannot find any package called compat.
Any idea what is broken on my system?
Thanks!
I have found same problem on Ubuntu 16 & 14.
Possible source of the problem is damaged instance of matplotlib. Damaged instance overlaps working instance of matplotlib.
Please try to remove broken instance of matplotlib to solve the issue.
Firstly I have looked matplotlib instances:
find / |grep matplotlib | grep __init__\.py$ |more
Secondly I have deleted this folder:
find /usr/share/pyshared/matplotlib -delete

ValueError with 'ciphers' when importing paramiko

I want to install paramiko on win 7 32bit ,the python is 3.3 .
I can compile it,but get follow errors:
Installed c:\python33\lib\site-packages\paramiko-1.8.0-py3.3.egg
Processing dependencies for paramiko==1.8.0
Searching for pycrypto==2.6
Best match: pycrypto 2.6
Adding pycrypto 2.6 to easy-install.pth file
Using c:\python33\lib\site-packages
Finished processing dependencies for paramiko==1.8.0
C:\Users\MC\Downloads\paramiko-paramiko-v1.8.0-9-g786920a>python
Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import paramiko
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".\paramiko\__init__.py", line 62, in <module>
from .transport import SecurityOptions, Transport
File ".\paramiko\transport.py", line 68, in <module>
class SecurityOptions (object):
ValueError: 'ciphers' in __slots__ conflicts with class variable
>>>
Paramiko does not run on Python 3. Yet. I'm working on a development branch (https://github.com/dorianpula/paramiko/tree/python3-support) to add support for Python 3, and I'm working on fixing this particular issue.

"import numpy" results in error in one eclipse workspace, but not in another

Whenever I try importing numpy in my new installation of Eclipse and Pydev, I get the following error:
Traceback (most recent call last):
File "Q:\temp\test.py", line 1, in <module>
import numpy
File "C:\Python26\lib\site-packages\numpy\__init__.py", line 132, in <module>
import add_newdocs
File "C:\Python26\lib\site-packages\numpy\add_newdocs.py", line 9, in <module>
from lib import add_newdoc
File "C:\Python26\lib\site-packages\numpy\lib\__init__.py", line 4, in <module>
from type_check import *
File "C:\Python26\lib\site-packages\numpy\lib\type_check.py", line 8, in <module>
import numpy.core.numeric as _nx
File "C:\Python26\lib\site-packages\numpy\core\__init__.py", line 13, in <module>
import defchararray as char
File "C:\Python26\lib\site-packages\numpy\core\defchararray.py", line 23, in <module>
from numpy.core.multiarray import _vec_string
ImportError: cannot import name _vec_string
However, in a vanila python console and in IPython, import is successful
Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>>
Q:\Groups\Bioinformatics\HPLCautomatization\autohplc>ipython
Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)]
Type "copyright", "credits" or "license" for more information.
IPython 0.10 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.
In [2]: import numpy
To make stuff even more complicated, in another Eclipse workspace, this import works fine. Restarting eclipse didn't help. I also tried to re-config the interpreter in Preferences->python->interpreter->python (as in this question), but the problem still exists
Two additional similar problems were described on SO (this and this), but both of them were observed with IronPython and I couldn't find anything I could use in the few answers that were provided.
EDIT As suggested by dutt, I checked Preferences->Pydev->Interpreter python->libraries in both the tested workspaces (the working one and the one that doesn't). The malfunctioning workspace contained the following library in system libs C:\Python26\lib\site-packages\numpy-1.5.0-py2.6-win32.egg . On the other hand, the working workspace doesn't list any numpy library in its system libraries list. I have removed the above library from the list in the not working workspace.
(Assuming you'r using PyDev) Look in Preferences->Pydev->Interpreter-Python->Libaries, you may have to add NumPy there. Should be located in your python/lib/site-packages folder.
check the version of your python release and numpy release. they should be the same.
It happened to me and I solved it re-installing my python and numpy for win32, although I have a 64-bit machine.

Categories

Resources