简体   繁体   English

github和Python 3.8有问题吗? 为什么我不能运行这段代码?

[英]Is there a problem with github and Python 3.8? Why can't I run this code?

I'm trying to run this code:我正在尝试运行这段代码:

!git clone https://github.com/sorki/python-mnist
!./python-mnist/get_data.sh
!pip3 install emnist
from emnist import extract_training_samples

But the following error message appears:但是出现以下错误信息:

Traceback (most recent call last):
  File "/Users/silteliz/Desktop/Solo Learn Python/NN 1.py", line 1
    !git clone https://github.com/sorki/python-mnist
    ^
SyntaxError: invalid syntax

I have Python 3.8.我有 Python 3.8。 Does anybody know what the problem might be?有谁知道问题可能是什么?

You can only use !你只能使用! if you're using ipython , for instance in Jupyter Notebook or the console of PyCharm if you enabled ipython as the default console interface.如果您使用ipython ,例如在 Jupyter Notebook 或 PyCharm 的控制台中,如果您启用ipython作为默认控制台界面。 If this is not the case, drop the !如果不是这种情况,请删除! and write the rest of your code in cmd .并在cmd中编写其余代码。

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

相关问题 为什么 tensorflow 不能在 Python 3.8 上运行? - Why doesn't tensorflow run on Python 3.8? 为什么我不能运行Python包corpcrawl的示例代码? - Why can't I run the example code of the Python package corpcrawl? 为什么我不能将 Python package 与 Python 要求“>=3.8,<3.11”安装到 Python 版本“^3.9”的 Poetry 项目中? - Why can't I install a Python package with the Python requirement ">=3.8,<3.11" into a Poetry project with the Python version "^3.9"? 为什么此Jupyter代码无法在Python中运行? - Why can't this Jupyter Code run in Python? 为什么我的状态码在 PyCharm (Python 3.8) 上不起作用 - Why isn't my status code working on PyCharm (Python 3.8) 我无法理解这个 python 代码中的问题 - I can't understand the problem in this python code 我无法在Spyder上运行我的Github代码 - i can't run my Github code on Spyder 为什么我不能让 Selenium 使用 Python 3.8 和 Chrome 在我的 WhatsApp Web 中编写消息? - Why can't I make Selenium write a message in my WhatsApp Web using Python 3.8 and Chrome? 为什么我不能在 Ubuntu 16.04 上安装 python3.8-dev? - Why can't I install python3.8-dev on Ubuntu 16.04? 我无法运行来自 github 的微软 python 扩展代码 - I can not run the microsoft python extension code from github
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM