简体   繁体   中英

Installing and importing Python Modules onto OS X

I've been trying for a couple of hours already. It seems IDLE can't find any third-party module. I am a Python beginner.

Here is some info about my system:

  • OSX version: 10.11.5
  • python version: Python 2.7, Python 3.4, Python 3.5

The initial installation using pip (among other methods) seems to work fine. When I repeat the installation, terminal responds with:

Requirement already satisfied (use --upgrade to upgrade): pyperclip in ./anaconda/lib/python3.4/site-packages

However, when I go to IDLE (Python 3.4) and try to import the module, IDLE responds with:

Traceback (most recent call last): File "", line 1, in import pyperclip ImportError: No module named 'pyperclip'

I have read that it may have something to do with my PATH or some virtual environment. I'll be frank, I'm not sure what to make of these as they seem beyond my current ability.

This inability to import modules is becoming an almost insurmountable roadblock to advancing with Python. If you can offer any ideas on what I can do or can ELI5 the solution, I am forever in your debt?

It seems you are using conda, but you are trying to install the pyperclip module with pip . Have you tried running conda install pyperclip ?

As stated here :

Because Conda introduces a new packaging format, you cannot use pip and Conda interchangeably; pip cannot install the Conda package format. You can use the two tools side by side but they do not interoperate either.

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