I installed anaconda to C:\Users\chris\Anaconda3. When I type conda list it verifies that I have BeautifulSoup4 installed.
However when I start C:\Users\chris\Anaconda3\python.exe and try to import BeautifulSoup it doesn't work:
>>> import BeautifulSoup
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'BeautifulSoup'
When I'm in the Anaconda Navigator it also lists the package but when I try to start base(root)/Open with python I can't import my package. Neither can Spyder that I installed.
What do I have to do, to fix this?
i'm sorry but maybe you need to import in this way ?
from bs4 import BeautifulSoup
docs
Related
I have some problems with the example of stable-baselines and look forward to your help.
The environment is set as:
Windows 10
spyder 3.6
tensorflow 1.4.0
gym 0.15.4
stable_baselines 2.8.0
However, I cannot import:
from stable_baselines.common import make_vec_env
The error is:
Traceback (most recent call last):
File "<ipython-input-96-9dcb30379014>", line 1, in <module>
from stable_baselines.common import make_vec_env
ImportError: cannot import name 'make_vec_env'
If this is the module we are talking about.
https://github.com/hill-a/stable-baselines
Seems like there was an issue that has been solved in 2.9.0:
https://github.com/araffin/rl-baselines-zoo/issues/51
Upgrade your stable-baselines:
pip install stable-baselines==2.9.0
And then it should be enough to use:
from stable_baselines.common.cmd_util import make_vec_env
I'm trying to import PyPDF2 and it won't work. I installed it using pip, then tried it with pip3, it is installed. When I try to import I get the error
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'PyPDF2'
I'm using Python 3.7. I found a similar issue here, doesn't seem any of the answers worked and I tried them myself to the same results.
If anyone else runs into this problem try using sys.path to find the site-packages directory. I copied my PyPDF2 packages into my Python37 directory and now it works.
Attempting to import and use pycountry in python 2.7.
import pycountry
len(pycountry.countries)
However, module is not recognised.
Traceback (most recent call last):
File "countries_list.py", line 1, in <module>
import pycountry
ImportError: No module named pycountry
You have to install it using pip.
pip install pycountry
And then you can use it :)
I had the same problem and looked thru several articles and youtube videos but none got my pycharm fixed to recognize the pycountry module until I tried executing the program in the pycharm IDE terminal and then the pycharm EDE started to recognize it.
I installed Flask-Paginate using pip, but when I try to import it I get ImportError: cannot import name 'Paginate'. How do I import this?
$ pip install -U flask-paginate
>>> from flask import Paginate
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'Paginate'
The package also isn't recognized in PyCharm.
Don't import it from flask, it's not part of Flask. Import it from flask_paginate, the module you installed. It's also called Pagination.
The docs show how to import it (although they are using the deprecated flask.ext notation).
from flask_paginate import Pagination
Configure the project interpreter in PyCharm to point to the virtualenv you installed the package to.
As mentioned in flask-paginate docs:
from flask.ext.paginate import Pagination
However, flask.ext is removed. Use this instead:
from flask_paginate import Pagination
I just compiled exiv2 and gexiv2 for my debian machiene and now I want to start working with gexiv2 to edit IPTC data using python. The gexiv2 website presents the following line of code:
from gi.repository import GExiv2
But that already results in:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named gi.repository
I can't even import gi so I think I'm missing another package!? What do I have to do to make this work as expected?
UPDATE: I upgraded my OS to the newest debian version. I can import gi now, but I'm still having trouble with GExiv2.
The following error occurs when importing GExiv2:
>>>from gi.repository import GExiv2
ERROR:root:Could not find any typelib for GExiv2
Hi i had the same problem i fixed it by installing gir1.2-gexiv2-0.4
I believe the package you need is python3-gi or, if you're using Python 2, python-gi.
Same problem here, I solved it by installing gir1.2-gexiv2-0.4 AND python-gobject