简体   繁体   中英

Unable to install modules for anaconda

abhigenie92@ubuntu:~/Desktop/pygame-1.9.1release$ which python
/home/abhigenie92/anaconda/bin/python
abhigenie92@ubuntu:~/Desktop/pygame-1.9.1release$ sudo apt-get install python-pygame
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-pygame is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 224 not upgraded.
abhigenie92@ubuntu:~/Desktop/pygame-1.9.1release$ python 
Python 2.7.10 |Anaconda 2.3.0 (64-bit)| (default, May 28 2015, 17:02:03) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://binstar.org
>>> import pygame
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named pygame

What is happening above? It seems to not install for anaconda. But it is directing to the right from path.

You are installing things into the system Python. You need to install into the Anaconda Python, using pip install pygame (note that sudo pip is likely going to use the system Python again, and using sudo with the Anaconda Python is not recommended anyway).

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