简体   繁体   中英

How to properly install a module in python?

I 'm new to python, and I need some help. At first i install pyperclip using command window: "pip3 install pyperclip". The command window responsed that I have downloaded the module successfully. However I can not use pyperclip in my code. When I coded "import pyperclip", there was an error: "No module name pyperclip..." I then changed the directory of the command window direct to the address of Python, but nothing seem to work. I use PyCharm for my coding. Hope you can hep me solve this problem. Python responsed "No module name pyperclip..."

It clearly that I have download the module.

Find path to python which you are using and then do something like:

path/to/python -m pip install pyperclip

Or better use conda or pipenv

The problem is that you have installed the package for another interpreter, one that is not used by your current project. How to install modules for a particular interpreter in PyCharm: https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-upgrading-packages.html

You can also select the interpreter for the particular configuration (setup used for running a script): https://www.jetbrains.com/help/pycharm/creating-and-editing-run-debug-configurations.html

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