回答此问题可获得 20 贡献值,回答如果被采纳可获得 50 分。
<p>文件路径:“C:\Users\Disander\anaconda3\python.exe”</p>
<p>当我从上面的路径打开python时,python显示以下警告:</p>
<pre><code>Python 3.7.6 (default, Jan 8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated. Libraries may fail to load. To activate this environment
please see https://conda.io/activation
Type "help", "copyright", "credits" or "license" for more information.
>>>
</code></pre>
<p>然后,当我尝试导入numpy或pandas时,它会抛出以下错误:</p>
<pre><code>Traceback (most recent call last):
File "C:\Users\Disander\anaconda3\lib\site-packages\numpy\core\__init__.py", line 24, in <module>
from . import multiarray
File "C:\Users\Disander\anaconda3\lib\site-packages\numpy\core\multiarray.py", line 14, in <module>
from . import overrides
File "C:\Users\Disander\anaconda3\lib\site-packages\numpy\core\overrides.py", line 7, in <module>
from numpy.core._multiarray_umath import (
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Disander\anaconda3\lib\site-packages\numpy\__init__.py", line 142, in <module>
from . import core
File "C:\Users\Disander\anaconda3\lib\site-packages\numpy\core\__init__.py", line 54, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy c-extensions failed.
- Try uninstalling and reinstalling numpy.
- If you have already done that, then:
1. Check that you expected to use Python3.7 from "C:\Users\Disander\anaconda3\python.exe",
and that you have no directories in your PATH or PYTHONPATH that can
interfere with the Python and numpy version "1.18.1" you're trying to use.
2. If (1) looks fine, you can open a new issue at
https://github.com/numpy/numpy/issues. Please include details on:
- how you installed Python
- how you installed numpy
- your operating system
- whether or not you have multiple versions of Python installed
- if you built from source, your compiler versions and ideally a build log
- If you're working with a numpy git repository, try `git clean -xdf`
(removes all files not under version control) and rebuild numpy.
Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.
Original error was: DLL load failed: The specified module could not be found.
>>>
</code></pre>
<p>如果我从anaconda终端启动python,python工作得非常好。我用importin numpy和pandas展示了这个。我导入sys并打印sys.executable以显示anaconda正在使用相同的python可执行文件python.exe</p>
<pre><code>(base) C:\Users\Disander>python
Python 3.7.6 (default, Jan 8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.executable)
C:\Users\Disander\anaconda3\python.exe
>>>
>>> import numpy
>>> import pandas
>>>
</code></pre>
<p>我还尝试在执行python.exe后激活(base)环境。下面,我展示了当我尝试使用“os.system('conda activate base')”时发生的情况</p>
<pre><code>>>> import os
>>> os.system('conda activate base')
'conda' is not recognized as an internal or external command,
operable program or batch file.
1
>>>
</code></pre>
<p>我想知道是否有办法执行python.exe文件,就像我使用(base)环境从anaconda执行它一样。我需要这个,因为我有另一个应用程序依赖于这个可执行文件。同一个应用程序使用它来导入模块,如numpy和pandas,但它不起作用</p>