简体   繁体   中英

how to install bottle package in python?

Facing problem while installing bottle package to python 2.7

I am using windows 7 system which having python 2.7 & 3.4.
'PY' command is for python 2.7 & 'PYTHON' command is for python 3.4

Now how to install bottle package in python 2.7

C:> py 
import bottle
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
ImportError: No module named bottle

I installed for python 3.4 using command.命令为 python 3.4 安装。
It's working fine for python 3.4

C:>python
import bottle

I am facing problem how to install bottle packages in python 2.7

This is how my python 3.4 directory looks

C:\Python34>dir
 Volume in drive C is System
 Volume Serial Number is 9CA3-A130
 Directory of C:\Python34<br />

 12/08/2014  09:49 PM    <DIR>          .
 12/08/2014  09:49 PM    <DIR>          ..
 12/08/2014  09:49 PM             1,024 add2virtualenv.bat
 12/08/2014  09:49 PM                83 cd-.bat
 12/08/2014  09:49 PM               644 cdproject.bat
 12/08/2014  09:49 PM               368 cdsitepackages.bat
 12/08/2014  09:49 PM               350 cdvirtualenv.bat
 09/28/2014  05:35 PM    <DIR>          distribution
 09/28/2014  01:28 AM    <DIR>          DLLs
 09/28/2014  01:28 AM    <DIR>          Doc
 12/08/2014  09:49 PM               421 folder_delete.bat
 09/28/2014  01:28 AM    <DIR>          include
 01/12/2015  01:36 AM    <DIR>          Lib
 09/28/2014  01:28 AM    <DIR>          libs
 05/18/2014  10:48 AM            31,073 LICENSE.txt
 12/08/2014  09:49 PM               997 lssitepackages.bat
 12/08/2014  09:49 PM               267 lsvirtualenv.bat
 12/08/2014  09:49 PM             1,947 mkvirtualenv.bat
 02/19/2011  01:40 AM           773,968 msvcr100.dll
 05/18/2014  10:33 AM           349,518 NEWS.txt
 05/18/2014  10:37 AM           102,400 py.exe
 05/18/2014  10:38 AM            27,136 python.exe
 05/18/2014  10:38 AM         2,734,592 python34.dll
 05/18/2014  10:39 AM            27,648 pythonw.exe
 05/18/2014  10:37 AM           102,912 pyw.exe
 05/04/2014  10:32 PM             6,942 README.txt
 12/08/2014  09:49 PM             1,000 rmvirtualenv.bat
 01/12/2015  01:35 AM    <DIR>          Scripts
 12/08/2014  09:49 PM               994 setprojectdir.bat
 09/28/2014  01:28 AM    <DIR>          tcl
 12/08/2014  09:49 PM               422 toggleglobalsitepackages.bat
 09/28/2014  01:28 AM    <DIR>          Tools
 12/08/2014  09:49 PM               183 whereis.bat
 12/08/2014  09:49 PM               936 workon.bat
          23 File(s)      4,165,825 bytes
          11 Dir(s)  30,791,503,872 bytes free
 C:\Python34>

I would recommend installing pip first and then running the command

pip install bottle

in your shell.

First install pip in your system. How to Install Pip on Ubuntu 18.04

Now, in new version of pip, you might need to enter

pip3 install bottle

Going forward, I realized having 2.x and 3.x will give me problems on installing via pip or pip3 I need to be very specific and I can't have multiple 3.x version at same time.

While coming to Linux and Mac there is a feature to differentiate python environments using pyenv , for Windows I have contributed recently called pyenv for windows pyenv-win . Hope this might help.

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