Cov txheej txheem:

Kuv yuav nruab Python li cas?
Kuv yuav nruab Python li cas?

Video: Kuv yuav nruab Python li cas?

Video: Kuv yuav nruab Python li cas?
Video: Creating a Virtual Environment within a Jupyter Notebook! 2024, Kaum ib hlis
Anonim

1 Teb

  1. Ua ntej, tshem tawm matplotlib = = 1.3.1 ntawm kev xav tau .txt.
  2. Tom qab ntawd sim ua nruab nws nrog sudo apt-get nruab python -matplotlib.
  3. Khiav pib install -r kev xav tau .txt ( Python 2), los yog 3 nruab -r kev xav tau .txt ( Python 3)
  4. pib khov > kev xav tau .txt.

Ua li no, kuv yuav ua li cas rau nruab ib cov ntaub ntawv Python?

Khiav Python Code

  1. Qhib koj lub davhlau ya nyob twg thiab ntaus cd (yog tias koj siv Windows, mus rau Python27 nplaub tshev).
  2. Tsim cov ntaub ntawv hu ua mycode.py (kom paub tseeb tias nws muaj. py extension).
  3. Qhib program.py siv koj cov ntawv nyeem nyiam.
  4. Ntxiv cov cai hauv qab no rau cov ntaub ntawv thiab txuag nws:

Ib yam li ntawd, TXT xav tau dab tsi hauv Python? txt Qhov no kev xav tau . txt cov ntaub ntawv yog siv los qhia txog dab tsi python pob khoom yog xav tau khiav qhov project koj tab tom saib. Feem ntau cov kev xav tau . txt cov ntaub ntawv nyob rau hauv lub hauv paus directory ntawm koj qhov project.

Ib tug kuj yuav nug, ua li cas koj tsim ib qho kev xav tau hauv Python?

Cov kev ua yuav zoo ib yam li cov hauv qab no:

  1. Tsim ib puag ncig virtual $ python3 -m venv /path/to/new/virtual/env.
  2. Nruab pob khoom siv $pip install command.
  3. Txuag tag nrho cov pob ntawv hauv cov ntaub ntawv nrog $ pip freeze > cov cai. txt.
  4. Pin tag nrho cov pob versions.
  5. Ntxiv cov cai.

PIP qhov yuav tsum tau ua txt yog dab tsi?

“ Kev xav tau cov ntaub ntawv yog cov ntaub ntawv uas muaj cov npe ntawm cov khoom yuav tsum tau ua ntsia siv pib install zoo li no: pib install -r kev xav tau . txt . Paub meej txog hom ntawv ntawm cov ntaub ntawv nyob ntawm no: Kev xav tau Cov ntaub ntawv hom. Logically, a Kev xav tau file tsuas yog ib daim ntawv teev npe pib install sib cav muab tso rau hauv ib cov ntaub ntawv.

Pom zoo: