Python 新手、PyCharm 和 Anaconda 问题 [英] Newbie Python, PyCharm and Anaconda issues

查看:62
本文介绍了Python 新手、PyCharm 和 Anaconda 问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是在线学习教程的新手.我在使用 PyCharm、Python 和 Anaconda 时遇到了真正的麻烦.两个问题:

I'm a newbie following tutorials online. I'm having real troubles with PyCharm, Python and Anaconda. Two questions:

(1) 当我在 CMD 中pip install x"时,它们似乎只安装在 Anaconda 站点包中,而不是 Python 包中.我是否需要同时安装两者才能访问?

(1) when I 'pip install x' in CMD, they only seem to install in Anaconda site packages, not the Python one. Do I need to install in both to have access in both?

(2) 我认为使用 Anaconda 的原因是它带有像 numpy 这样的软件包.当我在 Conda 或 Python39 环境中的 PyCharm 中导入 numpy"时,它说找不到模块,无论如何我都必须安装它.重点是什么?我为此创建了一个 PyCharm Conda 环境来使用这些包?

(2) I thought the reason to have Anaconda was because it came with packages like numpy. When I 'import numpy' in PyCharm in either Conda or Python39 environment, it says module not found and I have to install it anyway. What's the point? I created a PyCharm Conda environment for that reason to use the packages?

我有 C:...\anaconda3, .\scripts &.\bin 在系统 PATH 变量中,以及 C:...\Python39 &.\bin 在用户 PATH 变量中.

I have C:...\anaconda3, .\scripts & .\bin in system PATH variables, and C:...\Python39 & .\bin in user PATH variables.

如果有人能澄清事情,我将不胜感激.谢谢.

I'd be really grateful if someone could clarify things. Thanks.

INPUT-> C:\Users\tk20blue>where pip
C:\Users\tk20blue\anaconda3\Scripts\pip.exe
C:\Users\tk20blue\AppData\Local\Programs\Python\Python39\Scripts\pip.exe

INPUT-> C:\Users\tk20blue>where python
C:\Users\tk20blue\anaconda3\python.exe
C:\Users\tk20blue\AppData\Local\Programs\Python\Python39\python.exe
C:\Users\tk20blue\AppData\Local\Microsoft\WindowsApps\python.exe

INPUT-> C:\Users\tk20blue>where anaconda
C:\Users\tk20blue\anaconda3\Scripts\anaconda.exe

INPUT-> C:\Users\tk20blue>python --version
Python 3.8.5

INPUT -> C:\Users\tk20blue>py
Python 3.9.0 (tags/v3.9.0:9cf6752, Oct  5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

推荐答案

您有两个不同的 Python 安装同时运行.蟒蛇是蟒蛇.当你在安装 python 之后安装它时,你现在基本上有两个.您应该卸载 Python,然后重新安装 Anaconda.

You have two different python installs running at the same time. Anaconda is python. When you installed it after installing python, you essentially have two now. You should uninstall Python, and reinstall Anaconda.

我真的很喜欢 Anaconda 环境,您应该考虑使用 conda 来安装大部分/所有软件包.

I really like the Anaconda environment and you should really look at using conda to install most/all of your packages.

这是一个很棒的教程:https://www.datacamp.com/community/tutorials/installing-anaconda-窗户

这篇关于Python 新手、PyCharm 和 Anaconda 问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆