python怎么导入os模块,在OS X上安装和导入Python模块

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值