试图导入Json,我的命令是pip install json.我正在使用Windows 8.1
我在命令提示符下的错误是
Could not find a version that satisfies the requirements json <from versions:>
Run Code Online (Sandbox Code Playgroud)
No matching distribution found for json.
而我在pycharm上的错误是
NameError: name 'json' is not defined
Run Code Online (Sandbox Code Playgroud)
我尝试导入numpy,它工作得很好.我也检查了Pip"无法找到满足要求的"
并且找不到满足要求的版本<package>
编辑:也推荐到此链接Python 3.5.1:NameError:名称'json'未定义并且收到sudo无法识别的错误
with open(data_path) as f:
content = f.readlines()
content = [x.strip() for x in content]
Run Code Online (Sandbox Code Playgroud)
以下代码将读取每一行并将其插入列表中.但我想要的代码应该读取第一行并跳过第二行然后读取第三行或简单地调整内容以"删除"具有odd索引号的值.