I use xubuntu 14.04.3,and its default python version is python 2.7.6 and python 3.4.3.Then I download python 2.7.10 source code and compile install with command

sudo make -i install

make shows some modules not found:

INFO: Can't locate Tcl/Tk libs and/or headers

Python build finished, but the necessary bits to build these modules were not found:
_bsddb             _sqlite3           _ssl
_tkinter           bsddb185           bz2
dbm                gdbm               readline
To find the necessary bits, look in setup.py in detect_modules() for the module's name.

then I run sudo pip install pyftpdlib to install a module,then I can see it installs ok

pip show pyftpdlib
Metadata-Version: 2.0
Name: pyftpdlib
Version: 1.4.0
Summary: Very fast asynchronous FTP server library
Home-page: https://github.com/giampaolo/pyftpdlib/
Author: Giampaolo Rodola'
Author-email: g.rodola@gmail.com
License: MIT
Location: /usr/local/lib/python2.7/dist-packages

But when I import pyftpdlib in python shell or .py, python shows errorImportError: No module named pyftpdlib If I modified PYTHONPATH ,import modules is ok ,I should modified root and normal user, and when using sudo ,it's still shows cannot find module. How to solve this problem? or return to the default states.


check which version are you using. Then, run pip on the appropiate version using python -m pip (or python27 or python3 or whatever version you´re using on your script.

Also, you can specify which version should your script use by shebanging at the beginning

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.