VsCode开发--Python环境配置

2020年12月31日 08:52 by scott

vscode

问题:

之前一周用专业版的pycharm,但是现在过期了。无奈替换为vscode,听说的它的用户量仅次于pycharm。

可是以前好用的source_root设置没了。而且代码老是给我标波浪线,烦人。

解决方案:

经过搜索和总结,设置一个好用的开发环境,只需配置两步:

1. 配置项目的PYTHONPATH:在项目目录下新建一个文件(.env),填入

PYTHONPATH=./

如果是项目的src文件夹,可设置为:

PYTHONPATH=./src

2. 在配置文件(.vscode/settings.json)中配置路径,全部内容如下:

{
    "python.pythonPath": "/home/deepinwst/.conda/envs/di/bin/python",
    "python.linting.pylintEnabled": true,
    "python.linting.pycodestyleEnabled": false,
    "python.linting.enabled": true,
    "python.linting.pylintArgs": ["--generate-members"],
    "python.envFile": "${workspaceFolder}/.env",
    "terminal.integrated.env.osx": {
        "PYTHONPATH": "${workspaceFolder}",
      },
      "terminal.integrated.env.linux": {
        "PYTHONPATH": "${workspaceFolder}",
      },
      "terminal.integrated.env.windows": {
        "PYTHONPATH": "${workspaceFolder}",
      }
}

比如:

# .env
PYTHONPATH=./backend
# .vscode/settings.json
{
    "python.pythonPath": "/home/wst/miniconda3/envs/gohome/bin/python",
    "python.linting.pylintEnabled": true,
    "python.linting.pycodestyleEnabled": false,
    "python.linting.enabled": true,
    "python.linting.pylintArgs": ["--generate-members"],
    "python.envFile": "${workspaceFolder}/.env",
    "terminal.integrated.env.osx": {
        "PYTHONPATH": "${workspaceFolder}/backend",
      },
      "terminal.integrated.env.linux": {
        "PYTHONPATH": "${workspaceFolder}}/backend",
      },
      "terminal.integrated.env.windows": {
        "PYTHONPATH": "${workspaceFolder}}/backend",
      }
}

3. 重启vscode。

注:

第六行是防止from出现波浪线的,毕竟看着不爽。

terminal开头的哪些,是为了能让程序在终端中正确执行。

 

附常用操作:

VsCode 跳转到函数之后怎么跳转回之前的位置

Windows: Alt + '-' (有的是 Alt + ‘←’)
Ubuntu: Ctrl + Alt + '-'
Mac: control + '-'

 

完结,撒花。。。


Comments(128) Add Your Comment

Charlesnag
“I haven’t seen you in these parts,” the barkeep said, sidling settled to where I sat. “Name’s Bao.” He stated it exuberantly, as if word of his exploits were shared by means of settlers around multifarious a fire in Aeternum. He waved to a wooden butt upset us, and I returned his token with a nod. He filled a telescope and slid it to me across the stained red wood of the excluding in the vanguard continuing. “As a betting chains, I’d be willing to wager a fair speck of invent you’re in Ebonscale Reach in search more than the swig and sights,” he said, eyes glancing from the sword sheathed on my in to the bow slung across my back. https://images.google.co.ma/url?q=https://renewworld.ru/sistemnye-trebovaniya-new-world/
Kevingaw
https://images.google.sk/url?q=https://1xbitapk.com/es/ https://www.google.ms/url?q=https://stakesappbonus.com/de/ http://www.google.mw/url?q=https://www.hille-eventservice.de/news/wettannahmestellen_in_polen.html http://maps.google.com.gi/url?q=http://tanzschule-schrittfest.de/wp-content/pages/welche_online_casinos_sind_in_deutschland_legal__2.html http://www.google.md/url?q=https://1xbitapk.com/en-ng/
Fbgrlg
cheap lipitor 20mg <a href="https://lipiws.top/">atorvastatin price</a> purchase atorvastatin sale
Hptqwx
ciprofloxacin us - <a href="https://metroagyl.top/">buy generic cipro online</a> buy augmentin pill
Hsayte
order cipro 1000mg generic - <a href="https://cipropro.top/bactrimos/">sulfamethoxazole brand</a> order augmentin 625mg pill
Pwylcd
oral flagyl 400mg - <a href="https://metroagyl.top/cefaclor/">cefaclor 250mg ca</a> buy generic azithromycin online
Ozedsq
buy ciprofloxacin generic - <a href="https://septrim.top/chloromycetin/">order chloromycetin</a> erythromycin 500mg without prescription
Hnygvb
order generic valtrex - <a href="https://gnantiviralp.com/zovirax/">order acyclovir without prescription</a> acyclovir 800mg cost
Pcrqru
order stromectol online - <a href="https://keflexin.top/aczone/">how to get aczone without a prescription</a> how to get sumycin without a prescription
Gtguqi
metronidazole 200mg brand - <a href="https://metroagyl.top/azithromycin/">cost azithromycin 250mg</a> azithromycin 250mg uk
Rgttft
ampicillin order <a href="https://ampiacil.top/doxycyclineantb/">vibra-tabs online order</a> order amoxil without prescription
Ryidxo
furosemide sale - <a href="https://antipathogenc.com/atacand/">candesartan 8mg without prescription</a> capoten online
Pixjni
order glycomet 1000mg sale - <a href="https://gnantiacidity.com/combivir/">order lamivudine pill</a> buy generic lincomycin over the counter
Yfpgas
buy zidovudine 300 mg pills - <a href="https://canadiangnp.com/rulide/">roxithromycin 150 mg pills</a> allopurinol 300mg pills
Zfeiha
order clozapine 100mg generic - <a href="https://genonlinep.com/altace/">where can i buy altace</a> order pepcid 40mg generic
Wolwso
order quetiapine 100mg pill - <a href="https://gnkantdepres.com/zoloft/">order sertraline without prescription</a> eskalith over the counter
Akzhio
buy clomipramine 50mg generic - <a href="https://antdeponline.com/cymbalta/">cymbalta cost</a> doxepin 25mg pill
Srwhsb
buy hydroxyzine 25mg sale - <a href="https://antdepls.com/lexapro/">buy lexapro 20mg sale</a> buy endep pill
Tozrmv
amoxicillin online - <a href="https://atbioxotc.com/">cheap amoxicillin generic</a> buy generic ciprofloxacin for sale
Ahpshv
augmentin cheap - <a href="https://atbioinfo.com/">clavulanate where to buy</a> order ciprofloxacin 500mg pill
Xmtibi
buy cleocin 300mg generic - <a href="https://cadbiot.com/doxycycline/">cheap vibra-tabs</a> cheap chloromycetin without prescription
Kwntud
order zithromax 500mg pills - <a href="https://gncatbp.com/dofloxacin/">ofloxacin 200mg for sale</a> ciplox 500mg tablet
Zhazoc
stromectol cost in usa - <a href="https://antibpl.com/rferyc/">buy eryc 500mg for sale</a> buy cefaclor tablets
Kbeibx
order albuterol inhalator without prescription - <a href="https://antxallergic.com/advairdiskus/">advair diskus inhalator uk</a> order theophylline 400 mg without prescription
Encves
buy clarinex 5mg pills - <a href="https://rxtallerg.com/getzaditor/">order zaditor 1 mg sale</a> albuterol for sale online
Gndrak
medrol 16mg otc - <a href="https://ntallegpl.com/fluorometholone/">buy fml-forte online cheap</a> buy generic azelastine for sale
Swhbew
buy glyburide 2.5mg without prescription - <a href="https://prodeprpl.com/glipizide10/">glipizide online</a> cost dapagliflozin 10 mg
Fvgoii
order repaglinide 2mg online - <a href="https://depressinfo.com/">buy prandin 2mg online</a> jardiance online order
Jjexnp
order glucophage 1000mg pill - <a href="https://arxdepress.com/sitagliptin50/">buy januvia pills for sale</a> order acarbose 25mg without prescription
Cciuvw
order lamisil without prescription - <a href="https://treatfungusx.com/adiflucanv/">diflucan 200mg usa</a> where to buy griseofulvin without a prescription
Itxsfd
semaglutide 14 mg for sale - <a href="https://infodeppl.com/">cheap rybelsus</a> buy desmopressin generic
Wkdeef
order nizoral 200 mg online - <a href="https://antifungusrp.com/clotrithasone/">order lotrisone cream</a> sporanox 100mg pills
Mpkcyc
buy famciclovir tablets - <a href="https://amvinherpes.com/gnvalaciclovir/">valcivir 1000mg canada</a> purchase valcivir generic
Ltnjbf
lanoxin for sale - <a href="https://blpressureok.com/">buy generic digoxin online</a> buy furosemide cheap
Oalvfe
buy microzide 25 mg pill - <a href="https://norvapril.com/amlodipine/">purchase norvasc online cheap</a> zebeta online order
Zbjrej
lopressor cheap - <a href="https://bloodpresspl.com/olmesartan/">olmesartan 20mg price</a> adalat usa
Prnxir
buy nitroglycerin medication - <a href="https://nitroproxl.com/catapres/">clonidine 0.1mg ca</a> buy valsartan medication
Chuykj
rosuvastatin genuine - <a href="https://antcholesterol.com/pravastatin/">pravastatin buy wet</a> caduet pills course
Affdhg
simvastatin river - <a href="https://canescholest.com/gemfibrozil/">order lopid 300 mg without prescription</a> order lipitor 10mg without prescription
Unknso
viagra professional online moonlight - <a href="https://edsildps.com/cialisprofessional/">buy cialis professional suspicion</a> levitra oral jelly online timid
Cwnojs
priligy desert - <a href="https://promedprili.com/suhagra/">suhagra possess</a> cialis with dapoxetine ashamed
Nglgtn
cenforce shore - <a href="https://xcenforcem.com/silagrasildenafil/"></a> brand viagra pills real
Xdxykq
brand cialis pop - <a href="https://probrandtad.com/penisole/">penisole due</a> penisole mansion
Nggiqi
cialis soft tabs growl - <a href="https://supervalip.com/cialissuperactive/">cialis super active online trace</a>1 viagra oral jelly raise
Awtsyv
brand cialis wisdom - <a href="https://probrandtad.com/">brand cialis print</a> penisole defense
Ewnrut
cialis soft tabs pills violet - <a href="https://supervalip.com/cialissuperactive/">cialis super active track</a>1 viagra oral jelly online lest
Dpitgd
cenforce online chant - <a href="https://xcenforcem.com/zenegrasildenafil/">zenegra online monk</a> brand viagra pills piece
Hrgxxv
acne medication profession - <a href="https://placnemedx.com/">acne treatment tread</a> acne treatment terrace
Ktrmrw
inhalers for asthma tradition - <a href="https://bsasthmaps.com/">asthma treatment bad</a> asthma treatment bid
Xnnyhn
uti medication obvious - <a href="https://amenahealthp.com/">uti treatment fantastic</a> uti antibiotics rain
Vkbvae
prostatitis medications granny - <a href="https://xprosttreat.com/">prostatitis treatment planet</a> pills for treat prostatitis polite
Ynrksq
valtrex pills bunch - <a href="https://gnantiviralp.com/">valacyclovir online satisfaction</a> valtrex online distant
Lgyqft
claritin level - <a href="https://clatadine.top/">loratadine warmth</a> claritin shelf
Xscesm
loratadine ghastly - <a href="https://clatadine.top/">loratadine acquaintance</a> loratadine medication great
Nggfgk
priligy height - <a href="https://prilixgn.top/">priligy farther</a> priligy jail
Celtmw
promethazine pick - <a href="https://prohnrg.com/">promethazine mud</a> promethazine stomach
Cizmav
ascorbic acid remain - <a href="https://ascxacid.com/">ascorbic acid event</a> ascorbic acid tin
Nektia
biaxin pills point - <a href="https://gastropls.com/">clarithromycin advance</a> cytotec pills amongst
Nzvefg
florinef myrtle - <a href="https://gastroplusp.com/">florinef pills point</a> prevacid steam
Feeryi
buy generic bisacodyl - <a href="https://gastroinfop.com/liv52/">order liv52 online</a> liv52 20mg canada
Jnznsq
order aciphex online cheap - <a href="https://gastrointesl.com/domperidone/">purchase motilium</a> order domperidone
Kqfcpx
cotrimoxazole cost - <a href="https://tobmycin.com/">buy tobra 5mg online</a> buy tobra 10mg for sale
Pznpwt
eukroma online order - <a href="https://danaterone.shop/">zovirax creams</a> duphaston for sale
Cugbdp
dapagliflozin 10 mg sale - <a href="https://forpaglif.com/">order generic forxiga 10 mg</a> acarbose uk
Jvuvto
where to buy fulvicin without a prescription - <a href="https://fulviseoful.com/">fulvicin for sale online</a> lopid 300mg cost
Xrjppy
buy generic enalapril - <a href="https://doxapisin.com/">order doxazosin generic</a> buy generic zovirax
Ubdjqx
dramamine online - <a href="https://prasilx.com/">order prasugrel pill</a> purchase actonel generic
Rdghwk
monograph 600mg tablet - <a href="https://etodograph.com/">etodolac 600 mg uk</a> cilostazol 100mg oral
Keecml
piroxicam online buy - <a href="https://feldexicam.com/">order feldene 20mg</a> buy exelon
Ubpbjj
nootropil 800 mg ca - <a href="https://nootquin.com/praziquantel/">praziquantel 600 mg brand</a> order sinemet 20mg online
Aztmco
hydroxyurea for sale - <a href="https://hydroydrinfo.com/methocarbamol/">buy robaxin pill</a> methocarbamol 500mg without prescription
Afrhui
oral divalproex 500mg - <a href="https://adepamox.com/mefloquine/">lariam tablets</a> purchase topiramate for sale
Bgxxnd
norpace where to buy - <a href="https://anorpica.com/lamotrigine/">lamictal sale</a> chlorpromazine 50 mg cost
Eightw
buy cytoxan paypal - <a href="https://cycloxalp.com/stavudine/">zerit online buy</a> buy vastarel
Bxrmnf
buy spironolactone 25mg generic - <a href="https://aldantinep.com/dipyridamole/">purchase persantine pill</a> order naltrexone 50 mg sale
Owatav
purchase cyclobenzaprine pills - <a href="https://abflequine.com/enalapril/">buy vasotec 10mg generic</a> enalapril 5mg usa
Hungpp
ondansetron 8mg oral - <a href="https://azofarininfo.com/selegiline/">selegiline order</a> order ropinirole sale
Qpoptc
ascorbic acid 500 mg pill - <a href="https://mdacidinfo.com/lopinavirritonavir/">kaletra oral</a> prochlorperazine order online
Mqydzi
order durex gel - <a href="https://xalaplinfo.com/latanoprosteyedrops/">latanoprost cost</a> order latanoprost eye drops
Cjptwl
buy generic leflunomide online - <a href="https://infohealthybones.com/calciumcarbonate/">buy calcium carbonate generic</a> buy generic cartidin over the counter
Rxmksj
buy rogaine sale - <a href="https://hairlossmedinfo.com/finasteridefinp/">finpecia oral</a> purchase proscar sale
Zbmilx
atenolol where to buy - <a href="https://heartmedinfox.com/sotalol/">order sotalol 40mg sale</a> buy generic carvedilol for sale
Hcabkr
buy verapamil 240mg online - <a href="https://infoheartdisea.com/">buy verapamil 120mg for sale</a> buy tenoretic paypal
Kkpzhe
atorvastatin canada - <a href="https://infoxheartmed.com/enalapril/">order enalapril online cheap</a> buy nebivolol 20mg pills
Xzcouc
purchase lasuna pills - <a href="https://infoherbalmz.com/">purchase lasuna pill</a> himcolin where to buy
Flcfxa
purchase norfloxacin generic - <a href="https://gmenshth.com/">noroxin online order</a> buy confido without a prescription
Atsalb
buy speman pill - <a href="https://spmensht.com/">buy speman for sale</a> fincar pills
Ehqssp
finasteride tablet - <a href="https://finmenura.com/kamagra/">purchase sildenafil generic</a> alfuzosin 10 mg price
Wlrjea
buy hytrin no prescription - <a href="https://hymenmax.com/dutasteride/">dutasteride brand</a> order priligy 30mg pill
Hbafwd
buy oxcarbazepine pill - <a href="https://trileoxine.com/">buy trileptal online</a> synthroid 100mcg drug
Zhnxbe
duphalac bottless - <a href="https://duphalinfo.com/mentat/">order brahmi online cheap</a> order betahistine generic
Kxmopj
buy imusporin eye drops - <a href="https://asimusxate.com/">imusporin for sale</a> where can i buy gloperba
Zjvfuh
calcort pills - <a href="https://lazacort.com/">cheap calcort pill</a> order brimonidine for sale
Spempp
purchase neurontin pills - <a href="https://aneutrin.com/">generic gabapentin 100mg</a> purchase azulfidine generic
Oobvxa
buy besifloxacin eye drops - <a href="https://besifxcist.com/">buy cheap generic besivance</a> buy sildamax paypal
Pmoiol
cheap probenecid 500 mg - <a href="https://bendoltol.com/carbamazepine/">tegretol for sale online</a> buy carbamazepine 200mg generic
Jxpwfn
order celecoxib 100mg generic - <a href="https://celespas.com/">order celecoxib 100mg generic</a> buy indomethacin medication
Foklio
colospa uk - <a href="https://coloxia.com/etoricoxib/">buy arcoxia 120mg for sale</a> purchase pletal pills
Vwtiud
order voltaren 100mg generic - <a href="https://dicloltarin.com/aspirin/">aspirin 75 mg generic</a> buy aspirin 75 mg pill
Izhebi
cheap mestinon - <a href="https://mestonsx.com/azathioprine/">azathioprine oral</a> imuran ca
Wivhxr
order generic rumalaya - <a href="https://rumaxtol.com/amitriptyline/">purchase amitriptyline pill</a> buy amitriptyline 50mg generic
Khqzsv
cheap ozobax - <a href="https://baclion.com/nspiroxicam/">piroxicam brand</a> piroxicam cost
Ugvwdi
order diclofenac generic - <a href="https://vovetosa.com/tisosorbide/">isosorbide 40mg generic</a> buy generic nimotop
Ikhoum
buy cyproheptadine 4 mg sale - <a href="https://periheptadn.com/aszanaflex/">purchase tizanidine pills</a> cost tizanidine 2mg
Kwikqj
buy meloxicam 7.5mg sale - <a href="https://meloxiptan.com/">order mobic 7.5mg</a> toradol usa
Lzhrmk
omnicef usa - <a href="https://omnixcin.com/aminocycline/"></a> purchase cleocin generic
Hsolpe
trihexyphenidyl without prescription - <a href="https://voltapll.com/diclofenacgel/">emulgel buy online</a> diclofenac gel where to buy
Wldlqg
order deltasone without prescription - <a href="https://apreplson.com/permethrin/">order zovirax for sale</a> elimite creams
Fmnfvu
buy isotretinoin for sale - <a href="https://aisotane.com/asavlosulfon/">avlosulfon generic</a> deltasone 20mg cost
Akmazn
order acticin - <a href="https://actizacs.com/asbenzac/">order benzac without prescription</a> retin cost
Qdxlhb
betamethasone over the counter - <a href="https://betnoson.com/awdifferin/">adapalene canada</a> buy benoquin sale
Egbqou
order metronidazole 400mg online - <a href="https://cenforcevs.com/">buy cenforce 50mg pill</a> purchase cenforce generic
Pfguct
buy augmentin 1000mg for sale - <a href="https://baugipro.com/">buy augmentin 375mg pill</a> buy synthroid pills
Yvropa
buy losartan 50mg pill - <a href="https://acephacrsa.com/">buy keflex 125mg generic</a> keflex generic
Qnmpfx
buy cleocin 150mg - <a href="https://clinycinpl.com/">cheap cleocin 300mg</a> indomethacin uk
Vawlxo
eurax without prescription - <a href="https://aeuracream.com/abactroban/">buy generic mupirocin for sale</a> purchase aczone gel
Udgvvc
provigil cost - <a href="https://sleepagil.com/">order modafinil 200mg</a> how to buy melatonin
Rcsemt
zyban where to buy - <a href="https://bupropsl.com/ayurslim/">buy generic ayurslim online</a> order shuddha guggulu online cheap
Rtjmxv
xeloda 500mg usa - <a href="https://xelocap.com/">buy capecitabine 500 mg generic</a> purchase danocrine online
Hqdbea
brand progesterone 100mg - <a href="https://apromid.com/gynelotrimin/">oral ponstel</a> buy clomiphene tablets
Qylael
fosamax 35mg tablet - <a href="https://pilaxmax.com/medroxyprogesterone/">buy medroxyprogesterone sale</a> buy generic provera
Ecfrcl
buy generic norethindrone over the counter - <a href="https://norethgep.com/yasmin/">yasmin order</a> yasmin usa
Tgupub
yasmin buy online - <a href="https://festrolp.com/letrozole/">femara oral</a> order anastrozole 1 mg pill
Sgwqtq
oral cabergoline 0.25mg - <a href="https://adostilin.com/cabgolin/">cabgolin drug</a> cheap alesse for sale
Ofmqmm
プレドニン錠 5mg 強さ - <a href="https://jpaonlinep.com/">プレドニン 副作用</a> アジスロマイシン は通販での購
Bjhanb
г‚·гѓ«гѓ‡гѓЉгѓ•г‚Јгѓ«йЂљиІ©гЃ§иІ·гЃ€гЃѕгЃ™гЃ‹ - <a href="https://jpedpharm.com/tadalafil/">г‚їгѓЂгѓ©гѓ•г‚Јгѓ« гЃ©гЃ“гЃ§иІ·гЃ€г‚‹</a> г‚їгѓЂгѓ©гѓ•г‚Јгѓ«йЂљиІ©
Heptrk
プレドニン錠 40 mg 強さ - <a href="https://jpanfarap.com/jpaaccutane/">アキュテイン錠 5 mg 強さ</a> アキュテイン 飲み方
Uiqbab
eriacta although - <a href="https://eriagra.com/fforzestf/">forzest objection</a> forzest associate