ImportError: No module named 'twitter' - python

First file i'm trying to install an external package - twitter 1.14.3 (on windows 7)
so i downloaded the package to c:\python33\twitter-1.14.3,
then i run:
python.exe c:\python33\twitter-1.14.3\setup.py install
Finished processing..
Now i'm trying to use that new module:
from twitter import *
and i get an error:
Traceback (most recent call last):
File "test1.py", line 1, in <module>
\ufefffrom twitter import *
ImportError: No module named 'twitter'
When i'm trying to run the twitter.exe, i get:
c:\Python33\Scripts>twitter.exe
Traceback (most recent call last):
File "c:\Python33\Scripts\twitter-script.py", line 9, in <module>
load_entry_point('twitter==1.14.3', 'console_scripts', 'twitter')()
File "c:\Python33\lib\site-packages\setuptools-5.4.1-py3.3.egg\pkg_resources.py", line 356, in load_entry_point
File "c:\Python33\lib\site-packages\setuptools-5.4.1-py3.3.egg\pkg_resources.py", line 2476, in load_entry_point
File "c:\Python33\lib\site-packages\setuptools-5.4.1-py3.3.egg\pkg_resources.py", line 2190, in load
ImportError: No module named 'twitter'
Any ideas?
Thanks/

Navigate to your friendly neighborhood Command Prompt and type in the following:
pip install twitter
It should say something along the lines of "Installing collected packages... Successfully installed twitter-1.18.0"
Then run from your IDE:
import twitter # work with Twitter APIs
And proceed with setting up your API keys

Related

getting this error while loading a tensorflow project

getting a error while a installing a tensorflow python project from https://github.com/victordibia/skyfall
first i tried to install the requiremnt.txt file i got Could not detect requirement name for 'git+https://github.com/dpallot/simple-websocket-server.git', please specify one with #egg=your_package_name error,
then i removed the last line of txt file, then getting this
Traceback (most recent call last):
File "app.py", line 18, in
from utils import web_socket_server
File "C:\Users\anurag\Downloads\skyfall-master\utils\web_socket_server.py", line 4, in
from SimpleWebSocketServer import SimpleWebSocketServer, WebSocket
ModuleNotFoundError: No module named 'SimpleWebSocketServer'
after that i installed git , now getting this
Traceback (most recent call last):
File "app.py", line 19, in
from utils import web_socket_client
File "C:\Users\anurag\Downloads\skyfall-master\utils\web_socket_client.py", line 8, in
from websocket import WebSocketException, WebSocketConnectionClosedException
ImportError: cannot import name 'WebSocketException'
The error means that you have not installed this package: https://github.com/dpallot/simple-websocket-server
Try this to install it(you must have pip installed and also git) and then run the project again:
python -m pip install git+https://github.com/dpallot/simple-websocket-server.git

"No module named zlib" error anytime I use pip

I'm using terminal on mac, and anytime I attempt to use pip, I get the following error message telling me that it cannot find a module named zlib:
$ pip --version
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/requests/packages/__init__.py", line 27, in <module>
from . import urllib3
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/__init__.py", line 8, in <module>
from .connectionpool import (
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 42, in <module>
from .response import HTTPResponse
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 3, in <module>
import zlib
ModuleNotFoundError: No module named 'zlib'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.5/bin/pip", line 7, in <module>
from pip import main
File "/usr/local/lib/python3.6/site-packages/pip/__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/requests/__init__.py", line 62, in <module>
from .packages.urllib3.exceptions import DependencyWarning
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/requests/packages/__init__.py", line 29, in <module>
import urllib3
File "/usr/local/lib/python3.6/site-packages/urllib3/__init__.py", line 8, in <module>
from .connectionpool import (
File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 36, in <module>
from .response import HTTPResponse
File "/usr/local/lib/python3.6/site-packages/urllib3/response.py", line 3, in <module>
import zlib
ModuleNotFoundError: No module named 'zlib'
I've read several SO posts with the same error message, and have tried their solutions, including attempting to install zlib using homebrew, which fails, and updating my Xcode developer tools. I also installed pip earlier using python get-pip.py, and it said it installed successfully.
The reason I need pip is to install a package for use on python 2.7, but doing $ pip install "package-name" produces the same error as above. I have both Python 2 and 3 installed on my machine, if that helps. I'm kind of new to pip and using the command line in general, and I'm super confused; if anyone could help me out I'd really appreciate it.
This is the OP. I was able to fix the issue, and wanted to post my solution here in case it would help others.
Essentially I believe it occurred because Python2 is default on my machine, but pip is by default pointing to resources pertaining to Python3, or something like that. Doing pip2 --version instead provided the expected response.

Importing quandl using python 27

I'm trying to import quandl and have downloaded it from Github and unzipped it to C:\Python27\Lib\site-packages\quandl but whenever I run my file "quandltest.py", I get "ImportError: No module named inflection". I then downloaded inflection from Github and saved it to the site-packages folder but still get the following whenever I run the file. I'm using a Python 27 IDLE to import quandl (I get the same error using Pycharm). Anyone have any idea/the same issue?? Thanks! I also do not have access to my command window as it has been disabled by the admin so I cannot pip install.
Traceback (most recent call last):
File "C:/Python27/quandltest.py", line 1, in <module>
import quandl
File "C:\Python27\lib\site-packages\quandl\__init__.py", line 7, in <module>
from .model.database import Database
File "C:\Python27\lib\site-packages\quandl\model\database.py", line 11, in <module>
from quandl.connection import Connection
File "C:\Python27\lib\site-packages\quandl\connection.py", line 5, in <module>
from .util import Util
File "C:\Python27\lib\site-packages\quandl\util.py", line 1, in <module>
from inflection import parameterize
ImportError: No module named inflection

Cuckoo xmlrpclib missing while uploading file

I recently set up Cuckoo environment on Arch Linux host with WXPSP3 guest.
When I try to upload file for analysis using submit.py I get the following error:
Traceback (most recent call last):
File "./utils/submit.py", line 23, in <module>
from lib.cuckoo.common.utils import to_unicode
File "/opt/cuckoo/utils/../lib/cuckoo/common/utils.py", line 11, in <module>
import xmlrpclib
ImportError: No module named 'xmlrpclib'
I run out of ideas. Could you help?
J
It works if I run python via python2.7 command so:
# python2.7 ./utils/submit.py <filepath>

ImportError: No module named Scientific_numerics_package_id

I am trying to compile a python script for visualization of protein molecules using py2exe module. I've python2.7 running in win7 x64. When I try to execute the compiled file, it gives this error:-
C:\Python27\dist>visualn.exe
Traceback (most recent call last):
File "visualn.py", line 19, in <module>
File "MMTK\__init__.pyc", line 39, in <module>
File "Scientific\Geometry\__init__.pyc", line 30, in <module>
File "Scientific\Geometry\VectorModule.pyc", line 9, in <module>
File "Scientific\N.pyc", line 1, in <module>
ImportError: No module named Scientific_numerics_package_id
Without compiling I can run the script successfully. I've already installed scientific,MMTK modules. I got somewhere in the internet that Scientific_numerics_package_id module is available in netCDF4, so I installed that also but no good.
Any idea about the error?
You need the python-netcdf package.

Categories

Resources