美文网首页
Taichi 安装简要记录

Taichi 安装简要记录

作者: nase_luobeng | 来源:发表于2020-01-10 09:02 被阅读0次

    围观了知乎上大神的作品后(99行代码的《冰雪奇缘》

    https://zhuanlan.zhihu.com/p/97700605),连夜安装了Taichi 。

    安装过程中有几个小问题,简要记录一下吧,省得下回忘记了。

    机器上的python版本有3个,环境太复杂,不利于判断解决问题。第一步,先都卸载,然后选择安装python-3.7.6-amd64.exe,安装过程中注意勾选配置环境变量,注意这不是默认选项,之所以选择这个版本,而不是最新的 python-3.8.1,是因为 taichi 官网上写的3.6 或者 3.7,为减少可能出现的问题,所以选择安装 3.7 版本。

    使用pip安装,C:\Users\xxx>pip install taichi-nightly

    提示:

    WARNING: You are using pip version 19.2.3, however version 19.3.1 is available.

    You should consider upgrading via the 'python -m pip install --upgrade pip' command.

    按照提示,执行 python -m pip install --upgrade pip 升级 pip 版本;

    然后执行  python -m pip install taichi-nightly

    它会同时安装需要的其他第三方模块

    C:\Users\xxx>python -m pip install taichi-nightly

    Collecting taichi-nightly

      Downloading https://files.pythonhosted.org/packages/19/e1/2ae937db0dc0b238b2c026959552e257c236a76c1433d400fc96486474df/taichi_nightly-0.3.20-cp37-cp37m-win_amd64.whl (15.2MB)

        |████████████████████████████████| 15.2MB 656kB/s

    WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/numpy/

    Collecting numpy

      Downloading https://files.pythonhosted.org/packages/a9/38/f6d6d8635d496d6b4ed5d8ca4b9f193d0edc59999c3a63779cbc38aa650f/numpy-1.18.1-cp37-cp37m-win_amd64.whl (12.8MB)

        |████████████████████████████████| 12.8MB 6.4MB/s

    Collecting astor

      Using cached https://files.pythonhosted.org/packages/c3/88/97eef84f48fa04fbd6750e62dcceafba6c63c81b7ac1420856c8dcc0a3f9/astor-0.8.1-py2.py3-none-any.whl

    Collecting pybind11

      Using cached https://files.pythonhosted.org/packages/4b/4d/ae1c4d8e8b139afa9682054dd42df3b0e3b5c1731287933021b9fd7e9cc4/pybind11-2.4.3-py2.py3-none-any.whl

    Requirement already satisfied: setuptools in c:\users\nase\appdata\local\programs\python\python37\lib\site-packages (from taichi-nightly) (41.2.0)

    Collecting colorama

      Using cached https://files.pythonhosted.org/packages/c9/dc/45cdef1b4d119eb96316b3117e6d5708a08029992b2fee2c143c7a0a5cc5/colorama-0.4.3-py2.py3-none-any.whl

    Collecting pytest

      Using cached https://files.pythonhosted.org/packages/19/cf/711f1d887cb92c5155c9a1eb338f1b5d2411b50e4492a3b20e4a188a22b2/pytest-5.3.2-py3-none-any.whl

    Collecting packaging

      Using cached https://files.pythonhosted.org/packages/d8/5b/3098db49a61ccc8583ffead6aedc226f08ff56dc03106b6ec54451e27a30/packaging-20.0-py2.py3-none-any.whl

    Collecting importlib-metadata>=0.12; python_version < "3.8"

      Using cached https://files.pythonhosted.org/packages/e9/71/1a1e0ed0981bb6a67bce55a210f168126b7ebd2065958673797ea66489ca/importlib_metadata-1.3.0-py2.py3-none-any.whl

    Collecting attrs>=17.4.0

      Using cached https://files.pythonhosted.org/packages/a2/db/4313ab3be961f7a763066401fb77f7748373b6094076ae2bda2806988af6/attrs-19.3.0-py2.py3-none-any.whl

    Collecting atomicwrites>=1.0; sys_platform == "win32"

      Using cached https://files.pythonhosted.org/packages/52/90/6155aa926f43f2b2a22b01be7241be3bfd1ceaf7d0b3267213e8127d41f4/atomicwrites-1.3.0-py2.py3-none-any.whl

    Collecting wcwidth

      Using cached https://files.pythonhosted.org/packages/58/b4/4850a0ccc6f567cc0ebe7060d20ffd4258b8210efadc259da62dc6ed9c65/wcwidth-0.1.8-py2.py3-none-any.whl

    Collecting py>=1.5.0

      Using cached https://files.pythonhosted.org/packages/99/8d/21e1767c009211a62a8e3067280bfce76e89c9f876180308515942304d2d/py-1.8.1-py2.py3-none-any.whl

    Collecting pluggy<1.0,>=0.12

      Using cached https://files.pythonhosted.org/packages/a0/28/85c7aa31b80d150b772fbe4a229487bc6644da9ccb7e427dd8cc60cb8a62/pluggy-0.13.1-py2.py3-none-any.whl

    Collecting more-itertools>=4.0.0

      Using cached https://files.pythonhosted.org/packages/68/03/0604cec1ea13c9f063dd50f900d1a36160334dd3cfb01fd0e638f61b46ba/more_itertools-8.0.2-py3-none-any.whl

    Collecting pyparsing>=2.0.2

      Using cached https://files.pythonhosted.org/packages/5d/bc/1e58593167fade7b544bfe9502a26dc860940a79ab306e651e7f13be68c2/pyparsing-2.4.6-py2.py3-none-any.whl

    Collecting six

      Using cached https://files.pythonhosted.org/packages/65/26/32b8464df2a97e6dd1b656ed26b2c194606c16fe163c695a992b36c11cdf/six-1.13.0-py2.py3-none-any.whl

    Collecting zipp>=0.5

      Using cached https://files.pythonhosted.org/packages/74/3d/1ee25a26411ba0401b43c6376d2316a71addcc72ef8690b101b4ea56d76a/zipp-0.6.0-py2.py3-none-any.whl

    Installing collected packages: numpy, astor, pybind11, colorama, pyparsing, six, packaging, more-itertools, zipp, importlib-metadata, attrs, atomicwrites, wcwidth, py, pluggy, pytest, taichi-nightly

    Successfully installed astor-0.8.1 atomicwrites-1.3.0 attrs-19.3.0 colorama-0.4.3 importlib-metadata-1.3.0 more-itertools-8.0.2 numpy-1.18.1 packaging-20.0 pluggy-0.13.1 py-1.8.1 pybind11-2.4.3 pyparsing-2.4.6 pytest-5.3.2 six-1.13.0 taichi-nightly-0.3.20 wcwidth-0.1.8 zipp-0.6.0

    刚开始安装完毕后,发现在命令行上不能成功运行 taichi,在 python IDE 中却可以。

    搜了一下资料,在脚本最前面添加了

    import sys

    import time

    print (sys.path)

    后,发现使用的 path 中有之前的 python3.8 的库,故检查了一下本地文件目录,彻底删除了python38 目录,并重启了机器。再次尝试,发现问题解决。

    win10 下,python 安装在了 C:\Users\xxx\AppData\Local\Programs\Python\Python37 类似的目录下,安装的时候没注意,应该可以选择一个其他目录的吧,更方便一些。

    试着运行了几个示例代码,效果还是很震撼的,可以给儿子展示一下了。

    相关文章

      网友评论

          本文标题:Taichi 安装简要记录

          本文链接:https://www.haomeiwen.com/subject/hecpactx.html