【问题标题】:Sublime Text: Change default python.dll fileSublime Text:更改默认 python.dll 文件
【发布时间】:2015-12-20 23:17:16
【问题描述】:

当我尝试在 Sublime Text 中运行一些 Python 代码(可在 Anaconda Spyder 中运行)时,我收到此错误:

Python 3.5.1 |Anaconda 2.4.0 (64-bit)| (default, Dec  7 2015, 15:00:12) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> Traceback (most recent call last):
  File "C:\Anaconda3\lib\site-packages\pandas\__init__.py", line 7, in <module>
    from pandas import hashtable, tslib, lib
  File "pandas\src\numpy.pxd", line 157, in init pandas.hashtable (pandas\hashtable.c:38262)
  File "C:\Anaconda3\lib\site-packages\numpy\__init__.py", line 200, in <module>
    from . import add_newdocs
  File "C:\Anaconda3\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "C:\Anaconda3\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
    from .type_check import *
  File "C:\Anaconda3\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
  File "C:\Anaconda3\lib\site-packages\numpy\core\__init__.py", line 21, in <module>
    from . import _internal  # for freeze programs
  File "C:\Anaconda3\lib\site-packages\numpy\core\_internal.py", line 14, in <module>
    import ctypes
  File "C:\Anaconda3\lib\ctypes\__init__.py", line 7, in <module>
    from _ctypes import Union, Structure, Array
ImportError: Module use of python33.dll conflicts with this version of Python.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 5, in <module>
  File "C:\Anaconda3\lib\site-packages\pandas\__init__.py", line 13, in <module>
    "extensions first.".format(module))
ImportError: C extension: Module use of python33.dll conflicts with this version of Python. not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace' to build the C extensions first.

虽然 SublimeREPL 是 Python 3.5.1,但该程序似乎使用的是python33.dll。似乎应该使用python35.dll

C:\Program Files\Sublime Text,我看到python33.dll。所以,我把它放在一个临时文件夹中,然后把python35.dll(来自 Anaconda 文件夹)放在那里。我重新启动 Sublime Text。

然后,程序没有打开,说python33.dll 丢失。这让我觉得 Sublime Text 中有一些设置文件专门寻找python33.dll,它不会接受python35.dll

我浏览了 Sublime 的 PackageResourceViewer,在 Python 包中找不到任何表明 python33.dll 首选项的内容。作为参考,我的 PYTHONPATH 指向 C:\Anaconda3\,这是我的 Python 安装所在的位置。

有什么简单的方法可以在C:\Program Files\Sublime Text 中用python35.dll 切换python33.dll

【问题讨论】:

    标签: python-3.x sublimetext3


    【解决方案1】:

    正如您所发现的,您不应该这样做。 Python 3.3.3 被编译成 Sublime Text 3 二进制文件,用于运行 Python API 和插件系统等。插入 Python 3.5 .dll 会导致 ABI 和编译后的位之间发生各种冲突,从而杀死程序。

    因此,请编辑您的问题并发布您尝试运行的代码以及您尝试运行它的具体方式的详细信息,而不是摆弄它,我们可以进行故障排除而是那个。

    【讨论】:

      猜你喜欢
      • 2016-09-09
      • 2013-12-15
      • 2015-09-27
      • 1970-01-01
      • 1970-01-01
      • 2012-08-02
      • 1970-01-01
      • 2016-10-28
      • 1970-01-01
      相关资源
      最近更新 更多