在linux安装pycharm,有的包无法识别自动安装,并且在pycharm的python软件包安装窗口可以搜索出对应软件包,但是点击安装无反应。
在终端使用pip/pip3 install xxx,提示
error: externally-managed-environment
This environment is externally managed
To install Python packages system-wide, try apt install python3-xyz, where xyz is the package you are trying to install.
If you wish to install a non-Debian-packaged Python package, create a virtual environment using python3 -m venv path/to/venv. Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make sure you have python3-full installed.
If you wish to install a non-Debian packaged Python application, it may be easiest to use pipx install xyz, which will manage a virtual environment for you. Make sure you have pipx installd.
这个时候可以通过apt install python3-xyz安装,xyz是你要安装的包的名字。
具体原因好像是环境等问题,占不考虑。也使用了pipx安装,无效。
如果使用apt install安装,在终端下可以正常运行,但是pycharm还是无法运行,找不到对应的包。
这是因为pycharm用的不是系统的python3,需要在设置->项目:xxx(xxx是你的项目名称)->Python 解释器->添加解释器->选择系统本地的python添加进去。然后在右上角,运行调试->编辑配置->选择本地系统的python,就可以了
标签:python,xlsxwriter,environment,install,linux,PyCharm,安装,xyz,python3 From: https://www.cnblogs.com/studywithallofyou/p/18259530