Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I have installed a python library but dreampie won't import it

Tags:

python-3.3

I have installed a python library in python3.3. When I run the interpreter in Dreampie, it can't find my newly-installed library, resulting in an error like:

>>> from bs4 import BeautifulSoup
Traceback (most recent call last):
  File "<pyshell#4>", line 1, in <module>
    from bs4 import BeautifulSoup
ImportError: No module named 'bs4'
like image 202
jnnnnn Avatar asked May 15 '13 08:05

jnnnnn


People also ask

Why cant I import my modules in Python?

This is caused by the fact that the version of Python you're running your script with is not configured to search for modules where you've installed them. This happens when you use the wrong installation of pip to install packages.

Where are Python packages installed?

When a package is installed globally, it's made available to all users that log into the system. Typically, that means Python and all packages will get installed to a directory under /usr/local/bin/ for a Unix-based system, or \Program Files\ for Windows.


1 Answers

This is a dreampie 1.2.1 bug. To work around it, under Edit | Preferences | Shell, add the following line to the automatically-run code in the black box:

import site
site.main()
like image 92
jnnnnn Avatar answered Oct 23 '22 09:10

jnnnnn