Eclipse pydev 警告 - “未找到使用 cython 的调试器加速。”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/36680422/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Eclipse pydev warning - "Debugger speedups using cython not found."
提问by Clone
I get this warning while running a python program (some basic web automation using selenium):
我在运行 python 程序时收到这个警告(一些使用 selenium 的基本网络自动化):
warning: Debugger speedups using cython not found. Run '"/usr/bin/python3.5" "/root/.p2/pool/plugins/org.python.pydev_4.5.5.201603221110/pysrc/setup_cython.py" build_ext --inplace' to build. pydev debugger: starting (pid: 3502)
警告:未找到使用 cython 的调试器加速。运行 '"/usr/bin/python3.5" "/root/.p2/pool/plugins/org.python.pydev_4.5.5.201603221110/pysrc/setup_cython.py" build_ext --inplace' 进行构建。pydev 调试器:启动(pid:3502)
How can I address this issue?
我该如何解决这个问题?
回答by Fabio Zadrozny
This is as expected. Run"/usr/bin/python3.5" "/root/.p2/pool/plugins/org.python.pydev_4.5.5.201603221110/pysrc/setup_cython.py" build_ext --inplace
as it asks to get the debugger accelerations.
这正如预期的那样。"/usr/bin/python3.5" "/root/.p2/pool/plugins/org.python.pydev_4.5.5.201603221110/pysrc/setup_cython.py" build_ext --inplace
按照要求运行以获得调试器加速。
(Nb. The error in the comment below was because this answer was missing an initial double quote.)
(注意。下面评论中的错误是因为这个答案缺少初始双引号。)
Ideally run it from within your virtual environment, if you use one, to make sure you run this for the correct Python version. You'll need to run this once per Python version you use.
理想情况下,在您的虚拟环境中运行它(如果您使用),以确保为正确的 Python 版本运行它。您需要为您使用的每个 Python 版本运行一次。
回答by Pistis Valentino
simply copy all the command "/usr/bin/python3.5" "/root/.p2/pool/plugins/org.python.pydev_4.5.5.201603221110/pysrc/setup_cython.py" build_ext --inplace,
只需复制所有命令"/usr/bin/python3.5" "/root/.p2/pool/plugins/org.python.pydev_4.5.5.201603221110/pysrc/setup_cython.py" build_ext --inplace,
paste in a command line terminal (tipically bash shell) and press return :)
粘贴到命令行终端(通常是 bash shell)并按回车键 :)
回答by Vaibhav Suryawanshi
Installing PyDev plugin in eclipse doesn't enough to run python (*.py) file. This error will come if Microsoft Visual C++ Compiler for Python 2.7 is not installed, So if you look error message in eclipse console there you can find a link how to install this python compiler, what you can simply do is,
在 Eclipse 中安装 PyDev 插件不足以运行 python (*.py) 文件。如果未安装 Microsoft Visual C++ Compiler for Python 2.7,则会出现此错误,因此,如果您在 Eclipse 控制台中查看错误消息,您可以找到如何安装此 Python 编译器的链接,您可以简单地做的是,
1.Download Microsoft Visual C++ Compiler for Python 2.7 from http://aka.ms/vcpython27
1.从http://aka.ms/vcpython27下载 Microsoft Visual C++ Compiler for Python 2.7
2.Install downloaded package (.msi)
2.安装下载的包(.msi)
3.Go to command prompt in windows and change directory to "cd python27"
3.转到Windows中的命令提示符并将目录更改为“cd python27”
4.Run C:\Users\xyz\<path to you eclipse plugins> \org.python.pydev.core_6.3.2.201803171248\pysrc\setup_cython.py build_ext --inplace
4.运行 C:\Users\xyz\<path to you eclipse plugins> \org.python.pydev.core_6.3.2.201803171248\pysrc\setup_cython.py build_ext --inplace
5.Hit enter and wait unless compiler plugin install.
5.点击回车并等待编译器插件安装。
Voila! You have now installed python compiler.
瞧!您现在已经安装了 python 编译器。
Hope so It will help you. In my case it worked. Thanks!!!
希望它会帮助你。就我而言,它奏效了。谢谢!!!
回答by Sethu S
I faced a similar issue while using Python3.5 and Eclipse Pydev for debugging. when I tried
我在使用 Python3.5 和 Eclipse Pydev 进行调试时遇到了类似的问题。当我尝试
>"/usr/bin/python3.5" "/home/frodo/eclipse/plugins/org.python.pydev.core_6.3.3.201805051638/pysrc/setup_cython.py" build_ext --inplace
>"/usr/bin/python3.5" "/home/frodo/eclipse/plugins/org.python.pydev.core_6.3.3.201805051638/pysrc/setup_cython.py" build_ext --inplace
Traceback (most recent call last): File "/home/frodo/eclipse/plugins/org.python.pydev.core_6.3.3.201805051638/pysrc/setup_cython.py", line 14, in from setuptools import setup ImportError: No module named 'setuptools'
回溯(最近一次调用):文件“/home/frodo/eclipse/plugins/org.python.pydev.core_6.3.3.201805051638/pysrc/setup_cython.py”,第 14 行,来自 setuptools import setup ImportError: No module名为“安装工具”
Later I fixed the issue with the below commands to install setuptools and the related python3-dev libraries using
后来我使用以下命令修复了这个问题,以使用以下命令安装 setuptools 和相关的 python3-dev 库
sudo apt-get install python3-setuptools python3-dev
sudo apt-get install python3-setuptools python3-dev
and that resolved the issues while executing the above command.
并在执行上述命令时解决了问题。
回答by Mark Warburton
On ubuntu, I needed to do the following in a terminal:
在 ubuntu 上,我需要在终端中执行以下操作:
- sudo apt-get install build-essential
- sudo apt-get install python3-dev
- sudo apt-get install build-essential
- 须藤 apt-get 安装 python3-dev
I then copied the full setup path from the error in eclipse and onto my command prompt: python "/home/mark/.eclipse/360744347_linux_gtk_x86_64/plugins/org.python.pydev.core_6.5.0.201809011628/pysrc/setup_cython.py" build_ext --inplace
然后我将 eclipse 中的错误中的完整设置路径复制到我的命令提示符上: python "/home/mark/.eclipse/360744347_linux_gtk_x86_64/plugins/org.python.pydev.core_6.5.0.201809011628/pysrc/setup_cython.py" build_ext --就地
It finally compiled and the error message no longer appears.
它最终编译并且不再出现错误消息。
回答by MasterJoe2
I use python 3.3 interpreter, pydev and eclipse neon on Windows 7, 64 bit. I got the error:
我在 64 位 Windows 7 上使用 python 3.3 解释器、pydev 和 eclipse neon。我收到错误:
warning: Debugger speedups using cython not found. Run '"C:\Python33\python.exe" "C:\Users\user\.p2\pool\plugins\org.python.pydev_5.2.0.201608171824\pysrc\setup_cython.py" build_ext --inplace' to build.
pydev debugger: starting (pid: 8252)
warning: Debugger speedups using cython not found. Run '"C:\Python33\python.exe" "C:\Users\user\.p2\pool\plugins\org.python.pydev_5.2.0.201608171824\pysrc\setup_cython.py" build_ext --inplace' to build.
pydev debugger: starting (pid: 8252)
I am working on the solution now. This is an INCOMPLETE answer.
我现在正在研究解决方案。这是一个不完整的答案。
- Look at the python file mentioned in the error. Open it in a text editor like notepad++ & read the comments. Looks like we have to run this python script using
python setup_cython build_ext --inplace
. You must add .py after setup_cython to make this command work in windows.
- 查看错误中提到的python文件。在记事本++等文本编辑器中打开它并阅读评论。看起来我们必须使用
python setup_cython build_ext --inplace
. 您必须在 setup_cython 之后添加 .py 才能使此命令在 Windows 中工作。
To run this command, open cmd as administrator and then CD into the folder where the setup_cython script is stored (see it in error message). Then, run: python setup_cython.py build_ext --inplace
. Btw, if you get an error python is not recognized as an internal or external command, then refer this.
要运行此命令,请以管理员身份打开 cmd,然后将 CD 放入存储 setup_cython 脚本的文件夹中(在错误消息中查看)。然后,运行:python setup_cython.py build_ext --inplace
。顺便说一句,如果您收到错误 python 未被识别为内部或外部命令,请参考此.
Then, I got an error:
Traceback (most recent call last): File "setup_cython.py", line 25, in from setuptools import setup ImportError: No module named 'setuptools'
然后,我得到了一个错误:
回溯(最近一次调用):文件“setup_cython.py”,第 25 行,来自 setuptools import setup ImportError: No module named 'setuptools'
Looks like setuptools is missing and must be installed. Refer this link.
We will use the simplified windows instructions. Download the ez_setup.py script in any folder. Open cmd as administrator and then cd into that folder. Then run python ez_setup.py
似乎缺少 setuptools,必须安装。请参阅此链接。我们将使用简化的 windows 说明。在任何文件夹中下载 ez_setup.py 脚本。以管理员身份打开 cmd,然后 cd 进入该文件夹。然后运行python ez_setup.py
- Now, it will install a lot of files as part of setup tools. After completion, run the setup_cython script using
python setup_cython.py build_ext --inplace
. I got the error:
- 现在,它将安装许多文件作为安装工具的一部分。完成后,使用
python setup_cython.py build_ext --inplace
. 我收到错误:
running build_ext
building '_pydevd_bundle.pydevd_cython' extension
error: INCLUDE environment variable is empty
running build_ext
building '_pydevd_bundle.pydevd_cython' extension
error: INCLUDE environment variable is empty
Let me see what to do next.
让我看看接下来该怎么做。
回答by dotbit
with py 3.7 this does not build. but then, you just lose some speed-ups, not a big deal.
使用 py 3.7 这不会构建。但是,你只是失去了一些加速,没什么大不了的。
you get :
你得到 :
usr/local/bin/python3.7 ./setup_cython.py build_ext --inplace
running build_ext
building '_pydevd_bundle.pydevd_cython' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python3.7m -c _pydevd_bundle/pydevd_cython.c -o build/temp.linux-x86_64-3.7/_pydevd_bundle/pydevd_cython.o
_pydevd_bundle/pydevd_cython.c: In function ‘__Pyx__ExceptionSave':
_pydevd_bundle/pydevd_cython.c:28837:19: error: ‘PyThreadState {aka struct _ts}' has no member named ‘exc_type'; did you mean ‘curexc_type'?
*type = tstate->exc_type;