Python 2.7 import requests issue - python

I've tried to install requests module (Debian, Python 2.7) by pip install requests command. Output was:
Installing collected packages: urllib3, requests
Successfully installed requests-2.18.4 urllib3-1.22
Tried following the following Quickstart tutorial but I get the following error at import requests
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "requests/__init__.py", line 76, in <module>
check_compatibility(urllib3.__version__, chardet.__version__)
AttributeError: 'module' object has no attribute '__version__'
Any help?

Problem was with chardet package. Uninstalled it (pip uninstall chardet) and installed again and now it works. Cheers!

Related

Pyglet import not found when using pip

Ok so I'm trying to install pyglet using pip3 and I've used the command pip3 install pyglet and it works it's in my /usr/local/lib/python3.7/site-packages (1.4.9) and I am using python 3.7. I have successfully imported things using pip before, I've tried uninstalling and reinstalling... I'm not sure what the problem is the error message is
Traceback (most recent call last):
File "/Users/myname/Documents/plz.py", line 1, in <module>
import pyglet
ModuleNotFoundError: No module named 'pyglet'

beautifulsoup4 doesn´t work

I´ve already installed beautifulsoup4 but it doesn´t work.
This is the second time I try to install:
(k36) C:\GROWTHTECH\Projetos\blockchain>python -m pip install beautifulsoup4
Requirement already satisfied: beautifulsoup4 in c:\users\patff\appdata\local\conda\conda\envs\k36\lib\site-packages\beautifulsoup4-4.6.0-py3.6.egg
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
When I made a test:
>>> import beautifulsoup4
Traceback (most recent call last):
File "<console>", line 1, in <module>
ModuleNotFoundError: No module named 'beautifulsoup4'
>>> from BeautifulSoup import BeautifulSoup
Traceback (most recent call last):
File "<console>", line 1, in <module>
ModuleNotFoundError: No module named 'BeautifulSoup'
>>> exit()
The official import name of BeautifulSoup was changed to bs4 in version 4 [1] [2]. If it is installed correctly otherwise, import the package by calling:
import bs4

An issue about pysam installation

It's linux, using conda to install pysam, and pip install pysam keep failing.
After successful installed pysam,
pysam shows in conda list and appears in anaconda2/pkgs/
but when import pysam in python 2.7.12, it failed by Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named pysam
PLS help.

Yql import error in python

I am trying to import Yql but it throws the following error.I am using using ubuntu 10.04.
>>>import yql
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/yql/__init__.py", line 563, in <module>
class YahooToken(oauth.Token):
AttributeError: 'module' object has no attribute 'Token'
Any ideas on how to fix this?
Solved it.
There were other libraries that were messing with Yql.I removed python-oauth2,oauth2,Yql and reinstalled Yql.
sudo pip uninstall python-oauth2
sudo pip uninstall oauth2
sudo pip uninstall yql
sudo pip install yql

Having trouble installing buildslave on Windows 7

I finally got pip install buildbot-slave to work on Win7 (thanks to another answer on this site), and now when I attempt to create a build slave via:
buildslave create-slave slavefolder blah.blah.com:9989 buildslave password
It kicks back the following error:
Traceback (most recent call last):
File "C:\Python27\Scripts\buildslave", line 3, in <module>
from buildslave.scripts import runner
File "C:\Python27\lib\site-packages\buildslave\scripts\runner.py", line 22, in <module>
from twisted.python import reflect
File "C:\Python27\lib\site-packages\twisted\__init__.py", line 53, in <module>
_checkRequirements()
File "C:\Python27\lib\site-packages\twisted\__init__.py", line 37, in _checkRequirements
raise ImportError(required + ": no module named zope.interface.")
ImportError: Twisted requires zope.interface 3.6.0 or later: no module named zope.interface.
I've got it all installed here is my pip freeze:
Twisted==14.0.0
argparse==1.2.1
buildbot-slave==0.8.9
stevedore==0.15
virtualenv==1.9.1
virtualenv-clone==0.2.5
virtualenvwrapper==4.3.1
virtualenvwrapper-win==1.1.5
zope.interface==4.1.1
Any recommendations would be greatly appreciated.
Try to uninstall zope.interface and reinstall the version 3.6.0 using the command
pip uninstall zope.interface
pip install zope.interface==3.6.0
Hope this helps.

Categories

Resources