简体   繁体   English

Python安装的歧义

[英]Ambiguity on Python Installation

So I am new to Python and installed it using guidelines from various websites, as I want to try basic examples before moving on the advanced python concepts. 因此,我是Python的新手,并使用各种网站上的指南进行安装,因为我想在继续学习高级python概念之前尝试一些基本示例。 Below is my understanding and installation tasks that I performed. 以下是我执行的理解和安装任务。

1) Installed Python 2.7 form the website. 1)从网站安装了Python 2.7

2) Installed Anaconda as I read that it has pre installed libraries. 2)安装了Anaconda,因为我读到它已经预装了库。

3) Downloaded pip file and ran it on the Python interpreter and it was done successfully, but when I try using pip install ipython , it throws an error saying pip is not defined. 3)下载了pip文件并在Python解释器上运行了它,并成功完成了,但是当我尝试使用pip install ipython时 ,它会抛出一个错误,指出未定义pip

4)Now I downloaded Pycharm as a IDE, done successfully. 4)现在我已将Pycharm下载为IDE,成功完成了。

5) Programs run perfectly, but I see many instances of Ipthon on every related website and I am not able to understand if I need it. 5)程序运行完美,但是我在每个相关网站上看到很多Ipthon实例,我无法理解是否需要它。 Ipython is used for web I guess but I really don't understand how to integrate everything. 我猜Ipython用于网络,但我真的不明白如何集成所有内容。 Please guide me. 请指导我。

Thanks in advance. 提前致谢。

If you are using windows, pip error is probably related to environmental variables not being set. 如果您使用的是Windows,则点子错误可能与未设置环境变量有关。

See this answer for details on pip Adding Python Path on Windows 7 有关在Windows 7上pip 添加Python路径的详细信息,请参见此答案


response to comment 回应评论

Ipython is not necessary, but it will make life easier. Ipython不是必需的,但是它将使生活更轻松。 I use command prompt and am not familiar with installing packages with Pycharm or anaconda. 我使用命令提示符,并不熟悉使用Pycharm或anaconda安装软件包。

If Pip is installed, and the Windows environmental variable is not set, you can still use pip. 如果已安装Pip,但未设置Windows环境变量,则仍可以使用pip。

1) open a windows command prompt as administrator 2) navigate to your python installation ( default Directory is C:\\Python27 ) 3) navigate to scripts folder (default dir C:\\Python27\\Scripts) 4) type 'pip' 1)以管理员身份打开Windows命令提示符2)导航至python安装(默认目录为C:\\ Python27)3)导航至scripts文件夹(默认目录C:\\ Python27 \\ Scripts)4)输入“ pip”

5) type 'pip freeze' to see packages installed with pip. 5)输入“ pip Frozen”以查看pip安装的软件包。 Note: pip does not keep track of packages installed with conda 注意:pip不会跟踪conda安装的软件包

If you were able to complete those steps, changing the PATH variable to include the scripts directory will allow you to run pip by simply typing 'pip' from anywhere. 如果您能够完成这些步骤,则更改PATH变量以包括scripts目录将使您可以通过在任何地方键入“ pip”来运行pip。

To install Ipython: From command prompt with administrator rights: 'pip install ipython[all]' 要安装Ipython:在具有管理员权限的命令提示符下:'pip install ipython [all]'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM