“pip program issue in python” 可以翻译为 “Python 中的 pip 程序问题”。

huangapple go评论67阅读模式
英文:

pip program issue in python

问题

你好,以下是翻译好的部分:

"Python 3.11.3 (tags/v3.11.3:f3909b8, Apr 4 2023, 23:49:59) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information."

"SyntaxError: invalid syntax"

英文:

How do I use pip command in latest python????
I entered the code pip install pandas in the terminal but it shows error.

Python 3.11.3 (tags/v3.11.3:f3909b8, Apr  4 2023, 23:49:59) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

>>> pip install pandas
  File "<stdin>", line 1
    pip install pandas
        ^^^^^^^
SyntaxError: invalid syntax
>>>

</details>


# 答案1
**得分**: 2

退出Python REPL,请键入 `exit()` 并按回车键。或者在Windows上按Ctrl + Z,在Unix上按CTRL + D。

之后,输入以下命令:

```python
pip install pandas
英文:

Exit out of the Python Repl with by typing exit() and pressing Enter. Or press Ctrl + Z on Windows and CTRL + D if you are on Unix.

After that, enter the command:

pip install pandas

答案2

得分: 0

pip是一个Python模块,不应该像在脚本中那样直接运行。你可以在终端中运行pip install pandas,或者通过Python调用它:python -m pip install pandas

根据安装方式的不同,你可能需要将python替换为python3,将pip替换为pip3

英文:

pip is a Python module which is not supposed to be run like that in a script. You can either run, in a terminal, pip install pandas, or call it through Python : python -m pip install pandas.

You may have to replace python with python3 and pip by pip3 depending on how these are installed.

huangapple
  • 本文由 发表于 2023年5月25日 22:23:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/76333359.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定