Install python packages in Compose on Windows platform

作者: writer 分类: 数学 发布时间: 2017-07-31 13:34 ė 161 6 没有评论

Install python packages in Compose on Windows platform
solidThinking Compose comes with built-in Python environment that allows you to author, execute and debug python programs, and interchange data with Compose programs, which could be combined together to accomplish more complicated tasks.
Currently the version of built-in python is 3.4.0 of win64 arch. Pre-installed pacakges are listed as following:

  • Numpy – 1.9.2
  • Scipy – 0.15.1
  • Reportlab – 3.1.44
  • Colorama – 0.3.3
  • Ecdsa – 0.13
  • Matplotlib – 1.4.3
  • Pillow – 2.7.0
  • Pycrypto-2.6.1
  • PyTest-2.7.0
  • Requests – 2.9.1

Of course you can extend the list by installing more python pacakges in multiple ways

Multiple ways of installing Python packages

First of all you can use the pip command to install packages from offical repository.
You can run either python.exe

[/crayon]

or directly run pip.exe

[/crayon]

Alternatively, sometimes it’s wise to install a precompiled binary that downloaded from other sources, rather than install the the pacakge from online, which could require compling from source.
Resolving dependency issues is a tricky task on Windows.

  1. Download the wheel package from Python packages
  2. Use following commands to install the wheel pacakge

[/crayon]

Note: It is important to pay attention to the package name when downloading the packages from Python packages
Since the python environment version is 3.4.0 and system architecture is win64, you’ll need to get the package with the name like pandas-0.20.3-cp34-cp34m-win_amd64.whl for example.
Install python packages in Compose on Windows platform

How to uninstall a Python package

You’ll probably need administrator privilege to run this command

[/crayon]

Resolving compiling errors for missing MSVC compiler

In case of compiling the pacakge from souce codes (when you really would do so), an error like following could happen.

building ‘lxml.etree’ extension
error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat).

It is due to the python packages presumes Visual Studio 2010 shall be used on the Windows machine. If you have other versions of Visual Studio installed, you can bypass the error by redefining the environmental variable VS100COMNTOOLS

[/crayon]

本文出自扉启博客,转载时请注明出处及相应链接。

本文永久链接: https://www.feiqy.com/install-python-packages-in-compose-on-windows-platform/

发表评论

电子邮件地址不会被公开。 必填项已用*标注

Ɣ回顶部