python的exe可以用什么打开_如何执行python.exe的打开,就像从名为“ base”的anaconda环境中打开它一样?...

文件路径:“ C:\ Users \ Disander \ anaconda3 \ python.exe”

当我从上面的路径打开python时,python显示以下警告:

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.

>>>

然后,当我尝试导入numpy或pandas时,它将引发以下错误:

Traceback (most recent call last):

File "C:\Users\Disander\anaconda3\lib\site-packages\numpy\core\__init__.py", line 24, in

from . import multiarray

File "C:\Users\Disander\anaconda3\lib\site-packages\numpy\core\multiarray.py", line 14, in

from . import overrides

File "C:\Users\Disander\anaconda3\lib\site-packages\numpy\core\overrides.py", line 7, in

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 "", line 1, in

File "C:\Users\Disander\anaconda3\lib\site-packages\numpy\__init__.py", line 142, in

from . import core

File "C:\Users\Disander\anaconda3\lib\site-packages\numpy\core\__init__.py", line 54, in

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.

>>>

如果我从anaconda终端启动python,则python可以正常工作。我通过importin numpy和pandas展示了这一点。我导入sys并打印sys.executable以显示anaconda使用的是相同的python可执行文件python.exe。

(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

>>>

我还尝试在执行python.exe之后激活(基本)环境。下面,我展示了当我尝试使用“ os.system('conda activate base')”时发生的情况

>>> import os

>>> os.system('conda activate base')

'conda' is not recognized as an internal or external command,

operable program or batch file.

1

>>>

我想知道是否有一种执行python.exe文件的方法,就像我是使用(基本)环境从anaconda执行它一样。我需要这个,因为我有另一个依赖于此可执行文件的应用程序。相同的应用程序使用它来导入诸如numpy和pandas之类的模块,但无法正常工作。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值