简体   繁体   中英

Set python path variable in Linux Mint for Intellij Idea

What does it mean I install some python package by pip in Linux Mint, installed here: /home/user/.local/lib/python3.6/site-packages

user@user-H370M-DS3H:~/.local/lib/python3.6/site-packages$ pip3 show selenium
Name: selenium
Version: 3.141.0
Summary: Python bindings for Selenium
Home-page: https://github.com/SeleniumHQ/selenium/
Author: UNKNOWN
Author-email: UNKNOWN
License: Apache 2.0
**Location: /home/user/.local/lib/python3.6/site-packages**

But in Intellij Idea project interpretter cannot recognize this package: In Project Structure I see only path: /usr/lib/python3.8/site-packages with some others packages:

And the path /.local/lib/python3.6/site-packages Intellij Idea does't find. So all the python packages I install throw PIP in Linux console cannot recognize in Intellij Idea. How can I install python packages by Linux console without using Virtual Env for all projects?

If you set your pythonpath to point to the python IntelliJ knows about (pythonpath explained here ) then pip will install the selenium package to the right location.

At that point you are doing about half the work of a virtual environment though, so you should reconsider why you don't want to use virtual environments for every project.

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