python第三方模块安装_Python第三方模块全局导入

1586010002-jmsa.png

i'm currently into learning a bit of python and i want to import the paperclip third party module into my python file.

Yes, i already installed the pyperclip module with

pip install pyperclip.

if i create a file on my desktop, i get an error which says

Traceback (most recent call last):

File "test.py", line 1, in

import pyperclip

ImportError: No module named pyperclip

However if i put the test.py in my python folder, it runs.

The question now is, is there a way to make all my installed modules available on a global scope ? I just want to have my file e.g. on my Desktop and run it without having import issues.

Thank you.

Greetings

Edit: I'm working on a Mac, maybe this leads to the problem

解决方案

Found the problem.

The pip installautomatically used pip3.5 install

whereas python test.pydidn't use python3.5 test.py

Thank you @Bakurìu

Is there a way i can define python3.5as python?

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值