如何退出 anaconda 提示符并返回到 cmd 级别?
我运行打开 anaconda 提示符:
%windir%\System32\cmd.exe "/K" C:\folder\folder\anaconda3\Scripts\activate.bat activate tf_2_gpu
我可以“卸载”anaconda 并返回到通常的 cmd 对话框控制台吗?
我已将 Anaconda for data science 安装到我的计算机 ( http://anaconda.com/ ) 上,通过 Python 进行数据科学。当我完成课程的工作流程时,我在设置虚拟环境时遇到了问题,因此我跳过了这一步并使用了默认环境。
由于软件包的大小,我尝试使用 Windows 添加/删除程序卸载它,但现在我的命令提示符不再起作用。我尝试使用 powershell 恢复它,但 powershell 打开时出现提示:
& :术语“C:\Alan\Python\Anaconda3\Scripts\conda.exe”不被识别为 cmdlet、\function、script\file 或可操作程序的名称。检查名称的拼写,或者如果包含路径,请验证\路径是否正确\并重试。\在 C:\Users\Alan Curley\Documents\WindowsPowerShell\profile.ps1:4 char:4
(& "C:\Alan\Python\Anaconda3\Scripts\conda.exe" "shell.powershell" "h ... + CategoryInfo : ObjectNotFound: (C:\Alan\Python...ripts\conda.exe:String) [], \CommandNotFoundException + ExcellentQualifiedErrorId : CommandNotFoundException
表明 anaconda 及其环境的删除失败并留下了一些东西。
我尝试按照以下链接进行操作: 完全卸载 Anaconda 来重新安装 anaconda,但因为我的命令提示符不会启动,所以不会运行 anaconda 或 conda 来安装“clean anaconda”。
现在我关闭了所有依赖命令提示符才能工作的程序,但我不知道从哪里开始 - 有什么帮助吗?
我目前有一个用 pip3 生成的需求文件,如下所示:
pip3 freeze > requirements.txt
通过上述命令,我得到以下requirements.txt文件:
alabaster @ file:///home/ktietz/src/ci/alabaster_1611921544520/work
appdirs==1.4.4
argh==0.26.2
argon2-cffi @ file:///C:/ci/argon2-cffi_1613037869401/work
astroid @ file:///C:/ci/astroid_1623162452381/work
async-generator @ file:///home/ktietz/src/ci/async_generator_1611927993394/work
atomicwrites==1.4.0
attrs @ file:///tmp/build/80754af9/attrs_1620827162558/work
autopep8 @ file:///tmp/build/80754af9/autopep8_1615918855173/work
Babel @ file:///tmp/build/80754af9/babel_1620871417480/work
backcall @ file:///home/ktietz/src/ci/backcall_1611930011877/work
bcrypt @ file:///C:/ci/bcrypt_1607022693089/work
beautifulsoup4==4.9.3
black==19.3b0
Run Code Online (Sandbox Code Playgroud)
鉴于上述情况,我需要做什么才能使其看起来像下面的示例?
appdirs==1.4.4
argh==0.26.2
atomicwrites==1.4.0
beautifulsoup4==4.9.3
black==19.3b0
Run Code Online (Sandbox Code Playgroud) 我已使用命令“ conda install -c conda-forge transformers”从 Anaconda 管理员控制台在我的 Jupyter Notebook 中成功安装了 Transformer 包。
但是,当我尝试使用“ ”命令在 Jupyter 笔记本中加载 Transformer 包时import transformers,出现错误'ValueError: got_ver is None'。
我不知道如何解决这个问题。感谢任何投入。
下面是完整的错误:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-58-279c49635b32> in <module>
----> 1 import transformers
C:\ProgramData\Anaconda3\lib\site-packages\transformers\__init__.py in <module>
41
42 # Check the dependencies satisfy the minimal versions required.
---> 43 from . import dependency_versions_check
44 from .file_utils import (
45 _LazyModule,
C:\ProgramData\Anaconda3\lib\site-packages\transformers\dependency_versions_check.py in <module>
39 continue # not required, check …Run Code Online (Sandbox Code Playgroud) Windows 10 Python 3.1
我编写了一个需要 pandas 和 matplotlib 的脚本。但是,即使我尝试了 cmd 中的 pip 和 Miniconda 中的 conda,我在安装时也遇到了问题。
这是我在 cmd 中尝试通过 pip 安装时遇到的错误(即py -m pip install -U matplotlib:
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Nick\miniconda3\envs\name_of_my_env\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Nick\\AppData\\Local\\Temp\\pip-install-jlytfo2_\\matplotlib_5bffd16903a8431f98af43098502973c\\setup.py'"'"'; __file__='"'"'C:\\Users\\Nick\\AppData\\Local\\Temp\\pip-install-jlytfo2_\\matplotlib_5bffd16903a8431f98af43098502973c\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Nick\AppData\Local\Temp\pip-wheel-3tmzcurv'
cwd: C:\Users\Nick\AppData\Local\Temp\pip-install-jlytfo2_\matplotlib_5bffd16903a8431f98af43098502973c\
Complete output (551 lines):
Run Code Online (Sandbox Code Playgroud)
在 conda 中,当我尝试时conda …
我刚刚开始一份新工作,他们给了我一台 Mac pro 供我使用。我正在阅读有关新 M1 处理器和所有内容的信息,我发现这篇文章特别有用。
\n不过,我对此仍有一个疑问。如果我没有\xe2\x80\x99t误解,在文章中他们建议使用Anaconda(带有Rosetta2翻译),或者安装Miniforge,它将conda-forge设置为默认且唯一的通道,以便下载专门为M1。我找到了不同的教程,他们都建议使用 Miniforge 在 M1 上安装软件包。
\n我的问题是\xe2\x80\xa6can\xe2\x80\x99t 我只使用Anaconda,并将conda-forge设置为唯一的安装通道,以获得M1编译的软件包,就像使用Miniforge一样?还是我误解了什么?\n谢谢!
\n我正在尝试使用类来编写一个基本的平均计算器。但是,我收到错误
TypeError: Mean() missing 1 required positional argument: 'data'
Run Code Online (Sandbox Code Playgroud)
我有两个文件:一个包含具有平均函数的类,然后一个调用它,那就是我收到错误的时候。我的代码是:
class Statistics:
def __init__(self,mean_x,mean_y,var,covar):
self.mean_x=mean_x
self.mean_y=mean_y
self.var=var
self.covar=covar
def Mean(self,data):
return sum(data)/float(len(data))
Run Code Online (Sandbox Code Playgroud)
抛出错误的代码是:
from Statistics import Statistics
X=(0,1,3,5)
mean_x=Statistics.Mean(X)
print(mean_x)
Run Code Online (Sandbox Code Playgroud) 我\xe2\x80\x99m 是Python、Anaconda 和一般编程的新手。我的操作系统是 Windows 10。我最近安装了 Anaconda3 来获取 Python,但主要是通过 conda-forge 安装软件包。当我执行命令时,我的问题开始了:
\nconda install -c conda-forge x\nRun Code Online (Sandbox Code Playgroud)\n作为x我想要安装的软件包。\n当我这样做时,在某些时候我会收到此错误:
\n\nEnvironmentNotWritableError:当前用户没有目标环境的写权限。环境位置:C:\\ProgramData\\Anaconda3
\n
I\xe2\x80\x99m 非常确定如果我以管理员权限运行 anaconda 提示符,我的问题很容易解决,但我使用 \xe2\x80\x9cAnaconda Navigator\xe2\x80\x9d 运行它,所以我不\xe2\ x80\x99t 不知道以管理员身份运行导航器然后从那里启动提示符是否可以解决我的问题...还有其他选择吗?
\n我真的很感激任何有关此的信息,因为它可以解决我的问题,并教会我一些有关 conda 环境的信息。
\n当我尝试运行我的 python 项目时,在某些情况下我会收到此错误:
File "/usr/local/bin/AAA/camera_service/camera_service_main.py", line 6, in <module>
from views.hires_camera_handler_view import hires_camera_handler_blueprint
File "/usr/local/bin/AAA/camera_service/views/hires_camera_handler_view.py", line 7, in <module>
from hires_camera_handler.hires_camera_handler import HiResCameraHandler
File "/usr/local/bin/AAA/camera_service/hires_camera_handler/hires_camera_handler.py", line 3, in <module>
from ids_peak import ids_peak
File "/home/izx/anaconda3/envs/py38/lib/python3.8/site-packages/ids_peak/ids_peak.py", line 18, in <module>
from . import _ids_peak_python_interface
ImportError: libpython3.8.so.1.0: cannot open shared object file: No such file or directory
Run Code Online (Sandbox Code Playgroud)
目标文件存在于 ~/anaconda3/envs/py38/lib 中
我可以通过添加 export LD_LIBRARY_PATH=~/anaconda3/envs/py38/lib 来使代码在终端中运行
然而,这里似乎有一个更深层次的问题,因为我的更多项目的行为与其他 ubuntu 安装不同。我当然可以重新安装ubuntu。但我想了解我在这里做错了什么。
另外,上述解决方案并不能解决问题。我仍然无法在 PyCharm 中运行我的测试,这将非常有益。也许我可以以某种方式在我的 pycharm 运行中设置这个值,但是,设置路径变量不起作用,我不知道该怎么做。
我尝试过各种解决方案。安装 libpython3.8(已安装),安装 libpython3.8-dev(在 ubuntu 22.04 jammy 上不可用)。我还向 bashrc 添加了该值,但正如预期的那样,这并不能解决 PyCharm …
我有一个使用 Python 3.8.15 运行的 Conda 环境的 YML 文件 ( environment.yml)。我目前正在尝试根据以下答案将该文件加载到我的 Google Colab 中:
conda environment in google colab [google-colaboratory] 。
!wget -c https://repo.anaconda.com/archive/Anaconda3-2022.10-Windows-x86_64.exe
!chmod +x Anaconda3-2022.10-Windows-x86_64.exe
!bash ./Anaconda3-2022.10-Windows-x86_64.exe -b -f -p /usr/local
Run Code Online (Sandbox Code Playgroud)
虽然 Anaconda 的可执行文件安装在我的 Google Drive 文件夹中,但当我运行代码时,发现 Colab 无法执行该文件:
./Anaconda3-2022.10-Windows-x86_64.exe: ./Anaconda3-2022.10-Windows-x86_64.exe: cannot execute binary file
Run Code Online (Sandbox Code Playgroud)
我可以使用其他方法来安装 Anaconda 以便在 Google Colab 中使用它吗?此外,environment.yml让 Anaconda 在 Colab 中运行后,我应该如何加载我的文件?
anaconda ×10
python ×8
conda ×2
windows ×2
apple-m1 ×1
cmd ×1
conda-forge ×1
jupyter ×1
matplotlib ×1
pandas ×1
pip ×1
python-3.x ×1
shell ×1
ubuntu ×1
windows-10 ×1