sql >> Database teknologi >  >> RDS >> PostgreSQL

Repliker Python-miljøet på en anden computer

Da du bruger anaconda-miljø, antager jeg, at du har brugt virtualenv til det projekt, du nævnte. Det er faktisk nemt at replikere med følgende koder:

# list all virtualenvs in your anaconda folder
$ conda info –envs          # this will list all virtualenvs created by you, you can then choose the specific virtualenv here.

# to activate the virtualenv of your interest
$ conda activate [virtualenv_name] 

# export all packages used in the specific virtualenv (conda activated) 
$ pip freeze > requirements.txt             # save the output file as requirements.txt

# set up a new conda virtualenv in current or separate machine and install with the requirements.txt
$ conda create --name <env_name> python=3.6.5 --file requirements.txt  

# Please note that occasionally you may need to check requirements.txt if there is any abnormal list of packages. The format should be in either [package==version] or [package].

ELLER du kan oprette hele virtualenv direkte.

# copy exactly same virtualenv on separate machine

# export all packages used in the specific virtualenv (conda activated), including current python version and virtualenv name
$ conda env export > environment.yml        # save the output file as environment.yml    

# set up a new conda virtualenv in current or separate machine and install with the requirements.txt 
$ conda env create -f environment.yml       # using Conda; to modify “name” in the environment.yml file if to set up own same anaconda/machine



  1. OPRET DATABASE inde i transaktionen

  2. Sådan indsætter du kode sikkert i mySQL-databasen

  3. Hvordan håndterer man BLOB og CLOB i olingo v2?

  4. MAMP 2.0.1 med Ruby on Rails 3.2.0 på Mac OS X Lion