简体   繁体   中英

A pip module is available to python3.4 but getting an error when importing to python3.5

Ok, the general problem is that I can install a module say:

pip3 install xlsxwriter

and I can call it using python3.4

python3.4 >>> import xlsxwriter
python3.4 >>> success! 

however when I run it in python3.5 I get an error

python3.5 >>> import xlsxwriter
python3.5 >>> ImportError: no module named 'xlsxwriter'

I'm using Ubuntu Server 15.10 as my test box.

Any help would be greatly appreciated

The problem you have is that you have two python different python versions (3.4 and 3.5) that look for modules in two separate places. What this means is that python 3.4 will look for modules in a folder in the python 3.5 directory while python 3.5 will look for modules in a folder in the python 3.4 directory. To fix the issue that you are having, you must install the module in the python 3.5 directory. To do this go your command prompt and type:

cd C:\Python35\Scripts  # this is where I have my python 3.5 folder change the destination to where you have python 3.5 installed
pip install xlsxwriter

This should fix the issue. Hope it works!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM