import argostranslate.translate says "no module named lzma" - python

I have installed "argostranslate==1.7.5"
but when i try calling import argostranslate.translate in centos i'm getting
ModuleNotFoundError: No moduel named '_lzma'
I have tried all the steps in https://stackoverflow.com/a/57773679 but noting helps.

Finally, it has worked when I try to run my app in python version 3.9.6.
I hope it will help someone sometime somewhere.

Related

Python: ModuleNotFounderror: 'No module named image_downloader'

Code that worked for months suddenly stopped working.
In a file in the same directory 'downloaders', I have an import 'import image_downloader'. Somehow, the import doesn´t work anymore. The file that imports it is in the same directory.
My PyCharm IDE shows no problems at all, no warning or anything. But when I run it, the ModuleNotFoundError happens:
ModuleNotFoundError: No module named 'image_downloader'.
I have looked at similar questions here, but they haven´t helped me so far. I am desperate, and would be thankful for tips on resolving this annoying issue.
I found the solution. Not sure why it doesn´t work anymore with the old import style.
But what made it work: using absolute imports. This means in this case, instead of import image_downloader, I used from downloaders import image_downloader, even when the importing file is also in the package image_downloader.

Why ModuleNotFoundError is comming in my VSCode?

Please help. I did something (i dont know what) that I changed my path is VSCode.... This used to appear in the terminal before I run a code:
& python"c:/Users/Felipe/Desktop/Python/FINISHED PROYECTS/scraper/scraper.PY"
But know I get this:
c:/Users/Felipe/AppData/Local/Programs/Python/Python38-32/python.exe "c:/Users/Felipe/Desktop/Python/FINISHED PROYECTS/scraper/scraper.PY"
Also I cant import modules from git or from the internet. For example with the request module I get this:
ModuleNotFoundError: No module named 'requests'
Thanks very much!
It seems like the interpreter change causes this problem. As the interpreter of '...Python38-32/python.exe' hasn't installed packages you need, such as 'requests' package.
Select the right environment through: F1 --> Python:Select Interpreter.

Python not able to import any module

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

Import Error: Using Python with Geany

How can I add path to the PYTHONPATH environment variable
I tried using "sudo so" in .bash and also tried
export PYTHONPATH=$PYTHONPATH:/home/01_Understand/scitools/bin/linux32/python
but I am still getting import error.
I actually want to use Understand module (understand.py) with Geany but there is always an error stating
ImportError: No module named understand
Can anyone help me in this regard ?
Thanks

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