Python not able to import any module - python

I don't know whether I've just installed them wrong or there's another problem. I installed the ebay sdk but whenever I try to import it I get
ModuleNotFoundError: No module named 'ebaysdk'
Are there any common problems with this I could check for a solution? It shouldn't be the code as I copied it from the example code off the website.
Thanks for any help.
P.S I'm using 3.6

Related

Why am I unable to run the .login() attribute for robin_stocks?

I'm trying to import data from Robinhood through robin_stocks. I was able to import the package, but when I try to use the .login() attribute, it returns this error message in the Jupyter Notebook: error
module 'robin_stocks' has no attribute 'login'
I'm certain that robin_stocks does, indeed have the attribute that Python is telling me doesn't exist. Where did I go wrong here?
I'm relatively new to programming, but usually I can find an answer to my questions pretty quickly on StackOverflow or any other resource. I can't seem to figure this one out, though.
Any help would be greatly appreciated. Thank you!
I had the same error when upgrading from 1.7.x to 2.0.3
I was able to solve this by changing the import from:
import robin_stocks as rs
To:
import robin_stocks.robinhood as rs
Check the version of the package that you are using. I actually had the same issue when I migrated to a new laptop and installed packages again. I turned out that a newer robin-stocks python package got installed and resulted in an attribute error for my previously functioning code. When I reverted back to the older version of the package (1.5.5) my code worked like a charm.
Bro, we can't guess what you has typed in your code, please link it to us.
But if you have some issues with basic method of module, i think some thing gone wrong with import

How can I access to library " plot_utils " in python?

I need this library "plot_utils" for analysis and plotting but I can't find it in the web. this library is related to Brian2 (a library in python) for spiking neural network.
I installed brian2 through anaconda. when I want to import plot_utils and using in my code I receive error :
ModuleNotFoundError: No module named 'plot_utils'
Could you please help me?
You need to give more info about where did you stumble upon that name, eg some copied code etc.
With the only reference you've given (ie. brian2) this seems related.
https://brian2.readthedocs.io/en/stable/examples/frompapers.Stimberg_et_al_2018.plot_utils.html
Maybe just copy that code into a file named 'plot_utils.py' and keep it at the path your code is searching for it.
First, you need to install the module in your work environment using "pip install plot_utils" then you can import the library using "import plot_utils".
This link will help you: https://libraries.io/pypi/plot-utils[this is the official documentation from plot_utils]

Python No module named model in tia.analysis

My code has this import code:
import tia.analysis.ta as ta
And this is on init.py line 2 in "/usr/local/lib/python2.7/dist-packages/tia/analysis" after import code above:
from tia.analysis.model import *
Then the python 2.7.12 shell show this:
import tia.analysis.ta as ta
File "/usr/local/lib/python2.7/dist-packages/tia/analysis/__init__.py", line 2, in <module>
from tia.analysis.model import *
ImportError: No module named model
Can somebody tell me why the 'model' module in tia.analysis is unavailable even after I successfully install tia and using Python 2.7?
If somebody can also tell me the solution, I will be grateful.
I am not sure why that is happening, but I would check the physical location where the library is and see if you have all the files installed. If not, you can grab the tia analysis model folder here. Make sure you have this folder and then try again, hopefully that should fix it.
Reinstall tia from the official source.
Official source and installation instructions can be found here.

Python 2.7.9 troubles importing pysftp

I've been having troubles import pysftp. I currently have a server running some python scripts on a database, and decided to try and update this module which some of the scripts use. It broke a bunch of the scripts and then I had to go back and fix the versioning and to allow everything to function.
So far the only module I'm not able to import or use is pysftp. It throws the attached error. I've tried going into sites-manager and removing the files from there, however it has yet to help. Everything else has been working. Updating doesn't work either.
Any indication on how to resolve this error is greatly appreciated.
Error is:
ImportError: cannot import name util
I haven't been able to find a package called util to install. Please help! Attached link is of the trace.
http://imgur.com/a/9lQUj

Import failed when the module is already in the sys.path

It's weird to me that the import fails even when it's in the sys.path.
today, I set up a google app engine django environment on ubuntu in my lab's pc. And it works fine when I checked out the code and ran it in windows(same pc in the lab).
But when I went to the dorm, and checked out the code and start to run, it failed weirdly.
I print the sys.path, like this:
['/home/tower/googlecode/mygae', '/home/tower/googlecode/mygae/.google_appengine', '/home/tower/googlecode/mygae/.google_appengine/lib/antlr3', ...]
and when I ran python complained
from google.appengine.api import apiproxy_stub_map
ImportError: No module named appengine.api
it's easy to know the google module is in the '/home/tower/googlecode/mygae/.google_appengine'
directory, and the__init__.py for each module is present.
So what can be the reason for this weird thing? Or what I messed up probably?
thanks.
Can you import google and google.appengine?
Are you sure interpreter has read and traverse access rights to the module tree?
I had the same problem on Ubuntu when I wanted to play with google.appengine in console. First I tried to fix it by removing the /usr/lib/python2.7/dist-packages/google package altogether but Ubuntu One complained. Finally I resolved it by merging the GAE SDK google package into the package that caused the collision.
The contents of the /usr/lib/python2.7/dist-packages/google dir now look like this:
/google
/appengine
/net
/protobuf
/pyglib
/storage
/__init__.py
/__init__.pyc
Looks like you're getting a module (or package) called 'google' from elsewhere -- perhaps /home/tower/googlecode/mygae -- and THAT google module has no appengine in it. To check, print google.__file__ and if possible google.__path__; that should be informative.
Sometimes you can get an import error for a module when the error is something different, like a syntax error. Try putting
import pdb;pdb.set_trace()
just before the import and then s(tep) into the import, and n(ext) thruogh the module in question to see of you get an error.

Categories