A talk about Python environment

Source: Internet
Author: User

Recently discovered that there are multiple Python environments on the servers in the cluster, there are multiple versions of the same python, the main difference being that the modules installed in the site-packages are different, so the benefits of this configuration are that different types of projects can use their own Python environment without confusion, Just one time in the code to refer to a specific Python runtime environment, such as the following:

Import osos.environ['PYTHON'/opt/pythonenvs-dev/bin/python2.7 '

When configuring the environment for Python in Linux, you can log in under the specified user, install the Python environment, configure the environment to ~/.bash_profile, and then log on to the user and run the code when you need to run the code on the server.

Or you can configure all the environments you want for your project to a specific directory, and then configure it in the code block as described above in your project code.

The above method is only applicable to single-machine situation, if the use of advanced tools such as Docker to solve, nature is also possible, but I do not now, later use to write it again.

Finally attach the Python and Java configuration Parameters on Linux, for future reference use, so as to avoid Baidu every time to find, where the installation path as needed to modify.

# pythonexport path=/usr/local/bin/python2.7: $PATH#javaexport java_home=/usr/ lib/jvm/jdkexport CLASSPATH=".: $JAVA _home/lib: $CLASSPATH"export PATH ="$JAVA _home/: $PATH"

A talk about Python environment

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.