小白学习python的时候导入graphics库出现问题
Tofloor
poster avatar
liuguangjingshang
deepin
2017-07-24 19:22
Author
操作系统的deepin15.4.1最近刚开始学习python



Unresolved reference 'graphics' less... (Ctrl+F1)
This inspection detects names that should resolve but don't. Due to dynamic dispatch and duck typing, this is possible in a limited but useful number of cases. Top-level and class-level items are supported better than instance items.


报错结果如下
/usr/bin/python3.5 /home/song/PycharmProjects/study/tuxingkkudaoru.py
Traceback (most recent call last):
  File "/home/song/PycharmProjects/study/tuxingkkudaoru.py", line 1, in
    from graphics import *
ImportError: No module named 'graphics'

Process finished with exit code 1


是graphics只能在win下用吗?
如果linux也能用怎么去安装呢?
Reply Favorite View the author
All Replies
avatar
RedPanda
deepin
2017-07-24 19:38
#1
你这不是没装graphics这个module么。。。
Reply View the author
avatar
liuguangjingshang
deepin
2017-07-24 19:39
#2
windcz91 发表于 2017-7-24 11:38
你这不是没装graphics这个module么。。。

我知道啊,就是不知道怎么装。。。。网上都是win的教程,linux版又不是python的。。。。。
Reply View the author
avatar
RedPanda
deepin
2017-07-24 19:48
#3
https://bbs.deepin.org/post/143099
我知道啊,就是不知道怎么装。。。。网上都是win的教程,linux版又不是python的。。。。。 ...

http://blog.csdn.net/longerzone/article/details/17202301
Reply View the author
avatar
liuguangjingshang
deepin
2017-07-24 20:04
#4
  1. song@song-PC:~$ sudo pip install graphics
  2. sudo: 无法解析主机:song-PC
  3. [sudo] song 的密码:
  4. Collecting graphics
  5.   Could not find a version that satisfies the requirement graphics (from versions: )
  6. No matching distribution found for graphics
  7. song@song-PC:~$

Copy the Code
贼难受。。。
Reply View the author
avatar
RedPanda
deepin
2017-07-24 20:06
#5

换个pypi的镜像站试试?
Reply View the author
avatar
RedPanda
deepin
2017-07-24 20:37
#6

我上pypi上看了下,页面根本没有这个包。所以你得上github自己下载zip文件然后进目录自己安装
Reply View the author
avatar
isunny
deepin
2017-07-24 20:57
#7
最新版的 Python 是3.6.1  版
Reply View the author
avatar
liuguangjingshang
deepin
2017-07-24 21:29
#8
我觉得graphics在linux下用不了。。。。
Reply View the author
avatar
RedPanda
deepin
2017-07-24 23:17
#9
本帖最后由 windcz91 于 2017-7-24 15:23 编辑
https://bbs.deepin.org/post/143099
我觉得graphics在linux下用不了。。。。

你得上github下那个zip包自己安装在电脑上。https://github.com/olls/graphics 这是地址,直接下载这个包,然后解压,进文件夹,然后终端输入命令 python setup.py install 就把包给安装上了。
Reply View the author