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
Related
Whenever I try to import the libraries "beautifulsoup" or "requests" I always get the same error. The error I get looks like this... ModuleNotFoundError: No module named 'bs4'. I already have these libraries installed I just can't seem to figure out what's wrong.
If you look at the image below, I noticed when I use the recommended interpreter I get a problem saying "Import "bs4" could not be resolved from source". However, when I select one of the other Python 3.10.7 interpreters the problem goes away(see second picture). Either way I still get the Module not found error. I was thinking this info might help diagnose the problem I'm having.
I think you need to cross check environmental variable path of python and editor interpreter path
so, may be possible you downloaded that library but it available on another path for that he can't reach out and you get error
I am new with programming, so it is maybe harder for me to understand but I have the following issue:
I have a script that imports "eurostag.dll", which according to its manual, should work until Python 3.6. (but the manual is not updated, so it may work also with later updates, I assume).\ The issue is that I have Python 3.8. and when running the script I receive the following message:
"Failed to load EUROSTAG library (Could not find module 'D:\Eurostag\eustag_esg.dll' (or one of its dependencies). Try using the full path with constructor syntax.)"
I have tried to move the .dll library where the script is, but nothing changed. I tried also changing the directory with os.chdir, but the same message appears (with the same 'D:\Eurostag\eustag_esg.dll', so the directory was not changed.
Does anybody know if there is any workaround for this?
Thank you!
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
When I try to import time I get : No module named time
I have tried other time modules(datetime and timeit) and they work fine. I decided to check my installation and I can't find time.py anywhere. I checked the Lib, Scripts, libs and include folders, but can't find it anywhere.
Anyone know what I can do to fix this? Maybe download the .py and put it in Lib myself?
I am using Python 3.3.5 with PyCharm IDE. Only extra scripts I've installed is EasyInstall and PRAW.
The import does work. When PyCharm said No module named time, I assumed I would get a compiler error and started trying to fix it.
However when I eventually just ran the code it worked fine. I expect PyCharm doesn't detect the time module as it's a dll and not a py as noted by Martijn in the comments. This is on PyCharm Community Edition 4.0.4.
I tried playing with virtualenv and a host of other things, but I eventually went to Preferences -> Build, Execution, Deployment -> Console -> Python Console, and in the "starting script" box, I added two lines:
sys.builtin_module_names.append('sys')
sys.builtin_module_names.append('time')
This got rid of errors I had with both sys and time. Once I did that, I even get autocomplete for both of those modules... weird.
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.