I'm trying to set setup Python-Eve.
Python-Eve Installation Guide
I've finished these steps:
C:\Users\Ari\Desktop\rizzla>python -m pip install eve
Requirement already satisfied (use --upgrade to upgrade): eve in c:\python34\lib
\site-packages
Requirement already satisfied (use --upgrade to upgrade): cerberus<0.9,>=0.8 in
c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): events<0.3,>=0.2.1 in
c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): simplejson<4.0,>=3.3.0
in c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): werkzeug<0.10,>=0.9.4
in c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): markupsafe<1.0,>=0.23
in c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): jinja2<3.0,>=2.7.2 in
c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): itsdangerous<1.0,>=0.2
2 in c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): flask<0.11,>=0.10.1 in
c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): pymongo<3.0,>=2.7.1 in
c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): flask- pymongo<0.4,>=0.
3.0 in c:\python34\lib\site-packages (from eve)
But when trying to run the code on Quick Start Guide I get
Traceback (most recent call last):
File "run.py", line 1, in <module>
from eve import Eve
File "C:\Users\Ari\Desktop\rizzla\eve.py", line 1, in <module>
from eve import Eve
ImportError: cannot import name 'Eve'
My code is here:
from eve import Eve
app = Eve()
if __name__ == '__main__':
app.run()
Your script name is eve; same as the module you want to import. Rename your script name to other name to prevent the conflict.
Remove eve.pyc in the directory if there is.
Related
I am unable to install the python pubnub SDK on my Onion Omega 2 plus board. The installation always freezes at the following stage:
root#Omega-E5A5:/# pip3 install pubnub
Collecting pubnub
Using cached https://files.pythonhosted.org/packages/94/a4/321d50db8786e19e41be43da22fe38a03d5fc0560d9b815a8b5e11ea068e/pubnub-4.0.13.tar.gz
Collecting pycryptodomex>=3.3 (from pubnub)
Using cached https://files.pythonhosted.org/packages/6a/c4/21d55c2bf30995847406cb1a737d4ae5e19615eca39c9258f0548b5656f1/pycryptodomex-3.6.1.tar.gz
Requirement already satisfied (use --upgrade to upgrade): requests>=2.4 in /usr/lib/python3.6/site-packages (from pubnub)
Requirement already satisfied (use --upgrade to upgrade): six>=1.10 in /usr/lib/python3.6/site-packages (from pubnub)
Requirement already satisfied (use --upgrade to upgrade): idna<2.7,>=2.5 in /usr/lib/python3.6/site-packages (from requests>=2.4->pubnub)
Requirement already satisfied (use --upgrade to upgrade): urllib3<1.23,>=1.21.1 in /usr/lib/python3.6/site-packages (from requests>=2.4->pubnub)
Requirement already satisfied (use --upgrade to upgrade): certifi>=2017.4.17 in /usr/lib/python3.6/site-packages (from requests>=2.4->pubnub)
Requirement already satisfied (use --upgrade to upgrade): chardet<3.1.0,>=3.0.2 in /usr/lib/python3.6/site-packages (from requests>=2.4->pubnub)
Installing collected packages: pycryptodomex, pubnub
Running setup.py install for pycryptodomex ... /
I tried installing the pycryptodomex library manually with no success, still had the same problem. It freezes after a certain point during setup.py run.
I was able to install PubNub on my Mac.
'pip install pubnub'
ENV
what's your Python version?
python v3 got 'venv' by default,
have you tried installing 'pubnub' under a 'venv'?
Feel free to contact PubNub's support team, they are very helpful :)
I ran this command:
pip uninstall wagtail
Uninstalling wagtail: Proceed (y/n)? y
Successfully uninstalled
wagtail
However when I then ran pip install wagtail i received the following message:
root#daap:/usr/lib/python2.7# pip install wagtail
Requirement already satisfied (use --upgrade to upgrade): wagtail in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): Django<1.11,>=1.8.1 in /usr/local/lib/python2.7/dist-packages (from wagtail)
Requirement already satisfied (use --upgrade to upgrade): django-modelcluster<4.0,>=3.0 in /usr/local/lib/python2.7/dist-packages (from wagtail)
Requirement already satisfied (use --upgrade to upgrade): django-taggit<1.0,>=0.20 in /usr/local/lib/python2.7/dist-packages (from wagtail)
Requirement already satisfied (use --upgrade to upgrade): django-treebeard<5.0,>=3.0 in /usr/local/lib/python2.7/dist-packages (from wagtail)
Requirement already satisfied (use --upgrade to upgrade): djangorestframework>=3.1.3 in /usr/local/lib/python2.7/dist-packages (from wagtail)
Requirement already satisfied (use --upgrade to upgrade): Pillow>=2.6.1 in /usr/local/lib/python2.7/dist-packages (from wagtail)
Requirement already satisfied (use --upgrade to upgrade): beautifulsoup4>=4.5.1 in /usr/local/lib/python2.7/dist-packages (from wagtail)
Requirement already satisfied (use --upgrade to upgrade): html5lib<1,>=0.999 in /usr/local/lib/python2.7/dist-packages (from wagtail)
Requirement already satisfied (use --upgrade to upgrade): Unidecode>=0.04.14 in /usr/local/lib/python2.7/dist-packages (from wagtail)
Requirement already satisfied (use --upgrade to upgrade): Willow<0.5,>=0.4 in /usr/local/lib/python2.7/dist-packages (from wagtail)
Requirement already satisfied (use --upgrade to upgrade): requests<3.0,>=2.11.1 in /usr/local/lib/python2.7/dist-packages (from wagtail)
Requirement already satisfied (use --upgrade to upgrade): pytz>=2015.2 in /usr/local/lib/python2.7/dist-packages (from django-modelcluster<4.0,>=3.0->wagtail)
Requirement already satisfied (use --upgrade to upgrade): six in /usr/local/lib/python2.7/dist-packages (from html5lib<1,>=0.999->wagtail)
Cleaning up...
I am having problems that wagtail is not found when I run my django app, so I would like to completely uninstall it, then install it again.
Why isn't it being removed when I run pip uninstall wagtail? and how can I completely remove it? thanks
pip caches the python package. If you do not want to use the cache, you should use --no-cache-dir.
like this.
pip --no-cache-dir install -I wagtail
see also https://pip.pypa.io/en/stable/reference/pip_install/#caching
The cache dir is also written in this URL:)
source your-venv\bin\activate
pip install wagtail, django
To uninstall, make sure you have your venv activated. Just being in the dir does not mean you are inside virtualenv.
System: OX E
Python source: python.org
I used pip to install matplotlib and here is the result I got
sudo pip install matplotlib
The directory '/Users/clarence/Library/Caches/pip/http' or its parent
directory is not owned by the current user and the cache has been
disabled. Please check the permissions and owner of that directory. If
executing pip with sudo, you may want sudo's -H flag. The directory
'/Users/clarence/Library/Caches/pip' or its parent directory is not
owned by the current user and caching wheels has been disabled. check
the permissions and owner of that directory. If executing pip with
sudo, you may want sudo's -H flag. Requirement already satisfied (use
--upgrade to upgrade): matplotlib in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.5
in
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
(from matplotlib) Requirement already satisfied (use --upgrade to
upgrade): python-dateutil in
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
(from matplotlib) Requirement already satisfied (use --upgrade to
upgrade): tornado in /Library/Python/2.7/site-packages (from
matplotlib) Requirement already satisfied (use --upgrade to upgrade):
pyparsing>=1.5.6 in
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
(from matplotlib) Requirement already satisfied (use --upgrade to
upgrade): nose in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): certifi in
/Library/Python/2.7/site-packages (from tornado->matplotlib)
Requirement already satisfied (use --upgrade to upgrade):
backports-abc>=0.4 in /Library/Python/2.7/site-packages (from
tornado->matplotlib) Requirement already satisfied (use --upgrade to
upgrade): backports.ssl-match-hostname in
/Library/Python/2.7/site-packages (from tornado->matplotlib)
Requirement already satisfied (use --upgrade to upgrade):
singledispatch in /Library/Python/2.7/site-packages (from
tornado->matplotlib) Requirement already satisfied (use --upgrade to
upgrade): six in
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
(from singledispatch->tornado->matplotlib) Clarences-MacBook-Pro:~
clarence$ sudo -H pip install matplotlib Requirement already
satisfied (use --upgrade to upgrade): matplotlib in
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.5
in
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
(from matplotlib) Requirement already satisfied (use --upgrade to
upgrade): python-dateutil in
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
(from matplotlib) Requirement already satisfied (use --upgrade to
upgrade): tornado in /Library/Python/2.7/site-packages (from
matplotlib) Requirement already satisfied (use --upgrade to upgrade):
pyparsing>=1.5.6 in
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
(from matplotlib) Requirement already satisfied (use --upgrade to
upgrade): nose in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): certifi in
/Library/Python/2.7/site-packages (from tornado->matplotlib)
Requirement already satisfied (use --upgrade to upgrade):
backports-abc>=0.4 in /Library/Python/2.7/site-packages (from
tornado->matplotlib) Requirement already satisfied (use --upgrade to
upgrade): backports.ssl-match-hostname in
/Library/Python/2.7/site-packages (from tornado->matplotlib)
Requirement already satisfied (use --upgrade to upgrade):
singledispatch in /Library/Python/2.7/site-packages (from
tornado->matplotlib) Requirement already satisfied (use --upgrade to
upgrade): six in
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
(from singledispatch->tornado->matplotlib)
When I go ahead the import that library in python. python says it could not find the modulus.
python3.5 -c 'import matplotlib; print(matplotlib.__version__, matplotlib.__file__)'
Traceback (most recent call last): File "", line 1, in
ImportError: No module named 'matplotlib'
How can I fix this?
You need to install those libraries for the same version of python that you are using later to execute your code.
So if you want to use Python 2.7 you have to call
sudo pip2 install matplotlib
When using python 3.5 use it in a similar way
sudo pip3 install matplotlib
I use pip install scrapy to install scrapy
But I run scrapy get below error:
➜ source scrapy
Traceback (most recent call last):
File "/usr/local/bin/scrapy", line 7, in <module>
from scrapy.cmdline import execute
File "/Library/Python/2.7/site-packages/scrapy/__init__.py", line 48, in <module>
from scrapy.spiders import Spider
File "/Library/Python/2.7/site-packages/scrapy/spiders/__init__.py", line 10, in <module>
from scrapy.http import Request
File "/Library/Python/2.7/site-packages/scrapy/http/__init__.py", line 11, in <module>
from scrapy.http.request.form import FormRequest
File "/Library/Python/2.7/site-packages/scrapy/http/request/form.py", line 9, in <module>
import lxml.html
File "/Library/Python/2.7/site-packages/lxml/html/__init__.py", line 42, in <module>
from lxml import etree
ImportError: dlopen(/Library/Python/2.7/site-packages/lxml/etree.so, 2): Library not loaded: /opt/local/lib/libxslt.1.dylib
Referenced from: /Library/Python/2.7/site-packages/lxml/etree.so
Reason: image not found
It's strange scrapy look for libxslt.1.dylib in my /opt/ floder...
And I run pip install scrapy, get this:
➜ ~ pip install scrapy
Requirement already satisfied (use --upgrade to upgrade): scrapy in /Library/Python/2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): cssselect>=0.9 in /Library/Python/2.7/site-packages (from scrapy)
Requirement already satisfied (use --upgrade to upgrade): queuelib in /Library/Python/2.7/site-packages (from scrapy)
Requirement already satisfied (use --upgrade to upgrade): pyOpenSSL in /Library/Python/2.7/site-packages (from scrapy)
Requirement already satisfied (use --upgrade to upgrade): w3lib>=1.8.0 in /Library/Python/2.7/site-packages (from scrapy)
Requirement already satisfied (use --upgrade to upgrade): lxml in /Library/Python/2.7/site-packages (from scrapy)
Requirement already satisfied (use --upgrade to upgrade): Twisted>=10.0.0 in /Library/Python/2.7/site-packages (from scrapy)
Requirement already satisfied (use --upgrade to upgrade): six>=1.5.2 in /Library/Python/2.7/site-packages (from scrapy)
Requirement already satisfied (use --upgrade to upgrade): service-identity in /Library/Python/2.7/site-packages (from scrapy)
Requirement already satisfied (use --upgrade to upgrade): cryptography>=0.7 in /Library/Python/2.7/site-packages (from pyOpenSSL->scrapy)
Requirement already satisfied (use --upgrade to upgrade): zope.interface>=3.6.0 in /Library/Python/2.7/site-packages (from Twisted>=10.0.0->scrapy)
Requirement already satisfied (use --upgrade to upgrade): characteristic>=14.0.0 in /Library/Python/2.7/site-packages (from service-identity->scrapy)
Requirement already satisfied (use --upgrade to upgrade): pyasn1-modules in /Library/Python/2.7/site-packages (from service-identity->scrapy)
Requirement already satisfied (use --upgrade to upgrade): pyasn1 in /Library/Python/2.7/site-packages (from service-identity->scrapy)
Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/local/lib/python2.7/site-packages (from cryptography>=0.7->pyOpenSSL->scrapy)
Requirement already satisfied (use --upgrade to upgrade): enum34 in /Library/Python/2.7/site-packages (from cryptography>=0.7->pyOpenSSL->scrapy)
Requirement already satisfied (use --upgrade to upgrade): ipaddress in /Library/Python/2.7/site-packages (from cryptography>=0.7->pyOpenSSL->scrapy)
Requirement already satisfied (use --upgrade to upgrade): idna>=2.0 in /Library/Python/2.7/site-packages (from cryptography>=0.7->pyOpenSSL->scrapy)
Requirement already satisfied (use --upgrade to upgrade): cffi>=1.1.0 in /Library/Python/2.7/site-packages (from cryptography>=0.7->pyOpenSSL->scrapy)
Requirement already satisfied (use --upgrade to upgrade): pycparser in /Library/Python/2.7/site-packages (from cffi>=1.1.0->cryptography>=0.7->pyOpenSSL->scrapy)
Help!!
Update in 2015/11/06
Hi, Joe Young.
I have try this brew install libxml2 libxslt.But it doesn't work, It seems like my python's look path is wrong?
➜ haimi git:(V3.2.0) brew install libxml2 libxslt
Warning: libxml2-2.9.2 already installed
Warning: libxslt-1.1.28_1 already installed
➜ haimi git:(V3.2.0) ✗ scrapy
Traceback (most recent call last):
File "/usr/local/bin/scrapy", line 7, in <module>
from scrapy.cmdline import execute
File "/Library/Python/2.7/site-packages/scrapy/__init__.py", line 48, in <module>
from scrapy.spiders import Spider
File "/Library/Python/2.7/site-packages/scrapy/spiders/__init__.py", line 10, in <module>
from scrapy.http import Request
File "/Library/Python/2.7/site-packages/scrapy/http/__init__.py", line 11, in <module>
from scrapy.http.request.form import FormRequest
File "/Library/Python/2.7/site-packages/scrapy/http/request/form.py", line 9, in <module>
import lxml.html
File "/Library/Python/2.7/site-packages/lxml/html/__init__.py", line 42, in <module>
from lxml import etree
ImportError: dlopen(/Library/Python/2.7/site-packages/lxml/etree.so, 2): Library not loaded: /opt/local/lib/libxslt.1.dylib
Referenced from: /Library/Python/2.7/site-packages/lxml/etree.so
Reason: image not found
➜ haimi git:(V3.2.0) ✗
It sounds like you need the libxslt and libxml libraries which are required by the lxml python package, which is required by scrapy.
If you install the "X-code Command Line Tool package", it should include these libraries for you. There's a guide here: http://quantgreeks.com/how-to-install-xcode-command-line-tools-in-osx-yosemite/
Essentially it boils down to running:
xcode-select --install
I am experiencing the same problem as described in import matplotlib.pyplot hangs after updating my matplotlib version import matplotlib.pyplot as plt hangs while executing fc-list.
However, the proposed solution does not work for me; running fc-list in ~/.matplotlib takes 100% CPU and does not finish within 15 minutes.
I have the following configuration:
Mac, running OS 10.10.5 (OS X Yosemite)
Python 2.7.5
matplotlib 1.4.3 (was 1.3.1, no problems with that version)
To update my matplotlib version, I used:
sudo pip install matplotlib
If I re-run this command now, I get
Requirement already satisfied (use --upgrade to upgrade): matplotlib in /Library/Python/2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.6 in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): pytz in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): pyparsing!=2.0.0,>=1.5.6 in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): python-dateutil in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): nose>=0.11.1 in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): six>=1.4 in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): mock in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): funcsigs in /Library/Python/2.7/site-packages (from mock->matplotlib)
Requirement already satisfied (use --upgrade to upgrade): pbr>=0.11 in /Library/Python/2.7/site-packages (from mock->matplotlib)
and sudo pip install --upgrade matplotlib:
Requirement already up-to-date: matplotlib in /Library/Python/2.7/site-packages
Requirement already up-to-date: numpy>=1.6 in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already up-to-date: pytz in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already up-to-date: pyparsing!=2.0.0,>=1.5.6 in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already up-to-date: python-dateutil in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already up-to-date: nose>=0.11.1 in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already up-to-date: six>=1.4 in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already up-to-date: mock in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already up-to-date: funcsigs in /Library/Python/2.7/site-packages (from mock->matplotlib)
Requirement already up-to-date: pbr>=0.11 in /Library/Python/2.7/site-packages (from mock->matplotlib)
I have a fontList.cache file in ~/.matplotlib. This file is old (dating back to 2013, thus older than this update attempt).
Questions:
Despite the fontList.cache file, should I run fc-list, expecting it to finish at some point?
Is matplotlib expecting to find the fontList.cache file in a different location? Maybe my install/update of matplotlib messed up some path - but: matplotlib.get_cachedir() returns /Users/MyName/.matplotlib
Has the filename changed? Should I rename fontList.cache?
I do not have the /usr/X11/lindirectory anymore. However, could fc-list still enter an infinite loop as suggested?
I cannot reproduce the problem after posting the question.
I suspect that (re-)running
sudo pip install matplotlib
and/or
sudo pip install --upgrade matplotlib
while writing the question (to capture the on-screen output) fixed the previously existing issue.
fc-list now finished within 2 minutes; hough it did not create a new fontList.cache file.
I can now call import matplotlib.pyplot as plt as before.