a-bird
deepin
20 hours ago 你这个是在虚拟环境里吗?
如果没有的话,建议先创建虚拟环境,再试一试,应该就可以
Reply Like 0 View the author
你这个是在虚拟环境里吗?
如果没有的话,建议先创建虚拟环境,再试一试,应该就可以
系统版本23.1里的deepin-IDE,启动界面中,就会提示安装虚拟环境。
对了,如果使用的是deepin-ide的话,最好先创建工程, 别单独创建文件
sudo apt install python3-pip
试试看?
谢谢楼上指导。
我先在终端里运行了 sudo apt install python3-pip
,但是进入 IDE中执行调试还是提示安装调试器,不过这次点击提示中的【安装】按钮就成功的自动安装上了调试器。
但是在IDE中点运行或调试,程序执行都有一些问题。
我的程序代码很简单,文件名My01.py
if __name__ == "__main__":
print("Hello")
a=input()
a=int(a)
print(a+10)
在终端环境里执行 python My01.py,运行结果正常,先输出 Hello,再接收输入数字比如10,输出 20。
但是在IDE中点【运行】或【调试】,只输出Hello就结束了,不会等待输入。
这个是什么情况?还是说IDE 目前还很不完善?
再次打开IDE,又提示要安装什么依赖包,点了【安装】,下载安装了一大堆东西
~/Documents/Python$ python3 -m pip install python-lsp-server[all] --target /home/dave/.unioncode/packages/Python3.12.4 -i https://pypi.tuna.tsinghua.edu.cn/simple
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting python-lsp-server[all]
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/cb/e7/28010a326ef591e1409daf9d57a47de94156c147ad1befe74d8196d82729/python_lsp_server-1.12.2-py3-none-any.whl (74 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 74.8/74.8 kB 768.5 kB/s eta 0:00:00
Collecting docstring-to-markdown (from python-lsp-server[all])
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/56/7b/af3d0da15bed3a8665419bb3a630585756920f4ad67abfdfef26240ebcc0/docstring_to_markdown-0.17-py3-none-any.whl (23 kB)
Collecting jedi<0.20.0,>=0.17.2 (from python-lsp-server[all])
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/c0/5a/9cac0c82afec3d09ccd97c8b6502d48f165f9124db81b4bcb90b4af974ee/jedi-0.19.2-py2.py3-none-any.whl (1.6 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.6/1.6 MB 960.7 kB/s eta 0:00:00
Collecting pluggy>=1.0.0 (from python-lsp-server[all])
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl (20 kB)
Collecting python-lsp-jsonrpc<2.0.0,>=1.1.0 (from python-lsp-server[all])
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/cb/d9/656659d5b5d5f402b2b174cd0ba9bc827e07ce3c0bf88da65424baf64af8/python_lsp_jsonrpc-1.1.2-py3-none-any.whl (8.8 kB)
Collecting ujson>=3.0.0 (from python-lsp-server[all])
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/04/81/668707e5f2177791869b624be4c06fb2473bf97ee33296b18d1cf3092af7/ujson-5.10.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (53 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 53.7/53.7 kB 1.7 MB/s eta 0:00:00
Collecting autopep8<2.1.0,>=2.0.4 (from python-lsp-server[all])
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/d8/f2/e63c9f9c485cd90df8e4e7ae90fa3be2469c9641888558c7b45fa98a76f8/autopep8-2.0.4-py2.py3-none-any.whl (45 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 45.3/45.3 kB 122.1 kB/s eta 0:00:00
Collecting flake8<8,>=7.1 (from python-lsp-server[all])
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/83/5c/0627be4c9976d56b1217cb5187b7504e7fd7d3503f8bfd312a04077bd4f7/flake8-7.2.0-py2.py3-none-any.whl (57 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57.8/57.8 kB 8.1 MB/s eta 0:00:00
Collecting mccabe<0.8.0,>=0.7.0 (from python-lsp-server[all])
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/27/1a/1f68f9ba0c207934b35b86a8ca3aad8395a3d6dd7921c0686e23853ff5a9/mccabe-0.7.0-py2.py3-none-any.whl (7.3 kB)
Collecting pycodestyle<2.13.0,>=2.12.0 (from python-lsp-server[all])
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/3a/d8/a211b3f85e99a0daa2ddec96c949cac6824bd305b040571b82a03dd62636/pycodestyle-2.12.1-py2.py3-none-any.whl (31 kB)
Collecting pydocstyle<6.4.0,>=6.3.0 (from python-lsp-server[all])
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/36/ea/99ddefac41971acad68f14114f38261c1f27dac0b3ec529824ebc739bdaa/pydocstyle-6.3.0-py3-none-any.whl (38 kB)
Collecting pyflakes<3.3.0,>=3.2.0 (from python-lsp-server[all])
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/d4/d7/f1b7db88d8e4417c5d47adad627a93547f44bdc9028372dbd2313f34a855/pyflakes-3.2.0-py2.py3-none-any.whl (62 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.7/62.7 kB 220.5 kB/s eta 0:00:00
Collecting pylint<4,>=3.1 (from python-lsp-server[all])
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/e8/83/bff755d09e31b5d25cc7fdc4bf3915d1a404e181f1abf0359af376845c24/pylint-3.3.7-py3-none-any.whl (522 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 522.6/522.6 kB 298.3 kB/s eta 0:00:00
Collecting rope>=1.11.0 (from python-lsp-server[all])
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/a0/d0/e213e5adfa162e437dff3669131dc476043fc3a22fe99ef891516100610d/rope-1.13.0-py3-none-any.whl (206 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 206.5/206.5 kB 659.2 kB/s eta 0:00:00
Collecting yapf>=0.33.0 (from python-lsp-server[all])
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/37/81/6acd6601f61e31cfb8729d3da6d5df966f80f374b78eff83760714487338/yapf-0.43.0-py3-none-any.whl (256 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 256.2/256.2 kB 1.1 MB/s eta 0:00:00
Collecting whatthepatch<2.0.0,>=1.0.2 (from python-lsp-server[all])
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/8e/93/af1d6ccb69ab6b5a00e03fa0cefa563f9862412667776ea15dd4eece3a90/whatthepatch-1.0.7-py3-none-any.whl (11 kB)
INFO: pip is looking at multiple versions of flake8 to determine which version is compatible with other requirements. This could take a while.
Collecting flake8<8,>=7.1 (from python-lsp-server[all])
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/35/f8/08d37b2cd89da306e3520bd27f8a85692122b42b56c0c2c3784ff09c022f/flake8-7.1.2-py2.py3-none-any.whl (57 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57.7/57.7 kB 11.2 MB/s eta 0:00:00
Collecting parso<0.9.0,>=0.8.4 (from jedi<0.20.0,>=0.17.2->python-lsp-server[all])
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/c6/ac/dac4a63f978e4dcb3c6d3a78c4d8e0192a113d288502a1216950c41b1027/parso-0.8.4-py2.py3-none-any.whl (103 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 103.7/103.7 kB 705.3 kB/s eta 0:00:00
Collecting snowballstemmer>=2.2.0 (from pydocstyle<6.4.0,>=6.3.0->python-lsp-server[all])
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/c8/78/3565d011c61f5a43488987ee32b6f3f656e7f107ac2782dd57bdd7d91d9a/snowballstemmer-3.0.1-py3-none-any.whl (103 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 103.3/103.3 kB 815.2 kB/s eta 0:00:00
Collecting astroid<=3.4.0.dev0,>=3.3.8 (from pylint<4,>=3.1->python-lsp-server[all])
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/15/58/5260205b9968c20b6457ed82f48f9e3d6edf2f1f95103161798b73aeccf0/astroid-3.3.10-py3-none-any.whl (275 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 275.4/275.4 kB 980.3 kB/s eta 0:00:00
Collecting dill>=0.3.6 (from pylint<4,>=3.1->python-lsp-server[all])
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/50/3d/9373ad9c56321fdab5b41197068e1d8c25883b3fea29dd361f9b55116869/dill-0.4.0-py3-none-any.whl (119 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 119.7/119.7 kB 1.2 MB/s eta 0:00:00
Collecting isort!=5.13,<7,>=4.2.5 (from pylint<4,>=3.1->python-lsp-server[all])
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/c1/11/114d0a5f4dabbdcedc1125dee0888514c3c3b16d3e9facad87ed96fad97c/isort-6.0.1-py3-none-any.whl (94 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 94.2/94.2 kB 1.0 MB/s eta 0:00:00
Collecting platformdirs>=2.2 (from pylint<4,>=3.1->python-lsp-server[all])
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/fe/39/979e8e21520d4e47a0bbe349e2713c0aac6f3d853d0e5b34d76206c439aa/platformdirs-4.3.8-py3-none-any.whl (18 kB)
Collecting tomlkit>=0.10.1 (from pylint
最后一个 WARNING,不知道是要安装什么没有安装成功?
Popular Ranking
ChangePopular Events
More
用IDE写了一个简单的Python程序,想用调试功能,提示要安装调试器,点了【安装】,错误提示如下:
~/Documents/Python$ /usr/bin/python3.12 -m pip install debugpy --target /home/dave/.unioncode/packages/Python3.12.4 -i https://pypi.tuna.tsinghua.edu.cn/simple
/usr/bin/python3.12: No module named pip