When I run import theano in Python, I get the following error message:
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import theano
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/theano/__init__.py", line 74, in <module>
from theano.printing import pprint, pp
File "/usr/local/lib/python2.7/dist-packages/theano/printing.py", line 35, in <module>
if pd.find_graphviz():
AttributeError: 'module' object has no attribute 'find_graphviz'
What could be the issue, and how to fix it?
I use Theano 0.8.2 on Ubuntu 14.04.4 LTS x64 with Python 2.7.6 x64.
I unsuccessfully tried:
sudo apt-get install -y graphviz libgraphviz-dev
In pydot 1.2.x version,find_graphviz function have been deprecated. To fix this issue, you should install pydot 1.1.0 version here https://github.com/erocarrera/pydot/tree/v1.1.0 . And it is work for me. May help.
I solved by installing pydot-ng --> $ pip install pydot-ng
For some reason, the Python module pydot was creating the issue:
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import pydot
>>> pydot.find_graphviz()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'find_graphviz'
I was using pydot 1.2.2.
I uninstalled it using sudo pip uninstall -y pydot, and I then was able to successfully import theano.
Bug report: https://github.com/Theano/Theano/issues/4759
I solved it by using
sudo pip install graphviz
sudo apt-get install graphviz
with the pydot version 1.2.3 works fine
Related
Have Problem
fresh install Ubuntu 18 64bit
apt-get update
apt install python3-pip
alias pip=pip3
pip install uniswap-python
root#ubuntu:~# python3
Python 3.6.9 (default, Jan 26 2021, 15:33:00)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
from uniswap import Uniswap
Traceback (most recent call last):
File "", line 1, in
ImportError: cannot import name 'Uniswap'
what can i do please help
How can I install graph-tool for Anaconda Python 3.6.3 on macOS High Sierra? (I've been able to install graph-tool for Python 2.7.10.) Thanks!
I followed the instructions and first tried
brew tap homebrew/science
but got "Error: homebrew/science was deprecated. This tap is now empty as all its formulae were migrated." Anyhow, I found a solution (forgot the exact brew command) and ran
brew install graph-tool
It now says "Warning: brewsci/science/graph-tool 2.26_1 is already installed". I can then import graph-tool from python 2.7,
$ /usr/bin/python2.7
>>> from graph_tool.all import *
but not from the anaconda distribution,
$ python
Python 3.6.3 |Anaconda custom (64-bit)| (default, Oct 6 2017, 12:04:38)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from graph_tool.all import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'graph_tool'
How do I install the redhat yum packages within an anaconda environment on CentOS? These packages exist in the standard Centos dist:
$ lsb_release -d
Description: CentOS Linux release 7.3.1611 (Core)
$ python
Python 2.7.5 (default, Nov 6 2016, 00:28:07)
Type "help", "copyright", "credits" or "license" for more information.
>>> import rpm
>>> import yum
>>> print(rpm.__package__, rpm.__file__, rpm.__path__,rpm.__version__)
('rpm', '/usr/lib64/python2.7/site-packages/rpm/__init__.pyc', ['/usr/lib64/python2.7/site-packages/rpm'], '4.11.3')
>>> print(yum.__package__, yum.__file__, yum.__path__,yum.__version__)
('yum', '/usr/lib/python2.7/site-packages/yum/__init__.pyc', ['/usr/lib/python2.7/site-packages/yum'], '3.4.3')
I can't find similar packages (in the ways that I know) for anaconda:
$ source anaconda3/bin/activate python2.7
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import rpm;
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named rpm
>>> import yum
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named yum
>>>
pip and conda search don't seem to have these packages either.
When you run source
anaconda3/bin/activate python2.7
you are running python2.7 using a different virtual environment, where the package repository is different. You should source into the venv and install the packages there.
I'm trying to install pyOpenSSL using pip, python version is 2.7, OS is linux.
After pyOpenSSL installed, when I tried to import the module in python, I got the following error:
Python 2.7.5 (default, Jun 27 2013, 03:17:39)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import OpenSSL
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL
File "/usr/local/lib/python2.7/site-packages/OpenSSL/SSL.py", line 84, in <module>
OP_NO_TICKET = _lib.SSL_OP_NO_TICKET
AttributeError: 'FFILibrary' object has no attribute 'SSL_OP_NO_TICKET'
>>>
I tried to uninstall pyOpenSSL and install it again, but got the same error.
This is because low version pyopenssl has not defined SSL_OP_NO_TICKET。
clone the latest pyopenssl from https://github.com/pyca/pyopenssl.git and install it, then that'll be fine. no thks.
The fix is described here:
https://github.com/pyca/pyopenssl/issues/130
Indeed, you can apply it manually (not really recommended, but easy)
Or download archive from github
The link to the fix: https://github.com/pyca/pyopenssl/commit/e7a6939a22a4290fff7aafe39dd0db85157d5e05
And the fix applied to SSL.py
-OP_NO_TICKET = _lib.SSL_OP_NO_TICKET
+try:
+ OP_NO_TICKET = _lib.SSL_OP_NO_TICKET
+except AttributeError:
+ pass
I want to install pync on mac for showing notification. I tried with
$ pip install pync
git clone git://github.com/SeTeM/pync.git
cd pync
python setup.py install
sudo easy_install pync
Showing error as :
Last login: Thu Nov 21 12:20:51 on ttys000
fiss-Mac:~ fis$ python
Python 2.7.2 (default, Oct 11 2012, 20:14:37)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pync import Notifier
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.8-intel/egg/pync/__init__.py", line 3, in <module>
File "build/bdist.macosx-10.8-intel/egg/pync/TerminalNotifier.py", line 99, in <module>
File "build/bdist.macosx-10.8-intel/egg/pync/TerminalNotifier.py", line 27, in __init__
Exception: pync was not properly installed. Head over to https://github.com/SeTeM/pync/ and file a bug.
>>>
You should try pip3 install pync as pip3 works for mac rather than just pip . That is what you should try . If that doesn't work - then you should try to install it from the GitHub link like said in one of the above answers . Hope I was Helpful !! (:
It seems that the package for pync in the Python Package Index does not work properly.
Installing directly from the pync github repo will resolve the issue:
pip install git+https://github.com/SeTeM/pync.git
Just had the same issue.
Unzipping the egg file helped to solve the issue:
cd /Library/Python/2.7/site-packages
sudo unzip pync-1.4-py2.7.egg
sudo rm -r EGG-INFO pync-1.4-py2.7.egg
$ python
Python 2.7.6 (default, Nov 12 2013, 13:26:39)
[GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pync import Notifier
>>>