久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何使用 Anaconda 的 Python 版本執行 Python 腳本?

How can I execute Python scripts using Anaconda#39;s version of Python?(如何使用 Anaconda 的 Python 版本執行 Python 腳本?)
本文介紹了如何使用 Anaconda 的 Python 版本執行 Python 腳本?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我最近下載了 Python 的 Anaconda 發行版.我注意到,如果我編寫和執行 Python 腳本(通過雙擊其圖標),我的計算機(在 Windows 8 上運行)將使用我的舊版本 Python 而不是 Anaconda 的版本來執行它.例如,如果我的腳本包含 import matplotlib,我會收到一個錯誤.有沒有辦法讓我的腳本改用 Anaconda 的 Python 版本?

I recently downloaded the Anaconda distribution for Python. I noticed that if I write and execute a Python script (by double-clicking on its icon), my computer (running on Windows 8) will execute it using my old version of Python rather than Anaconda's version. So for example, if my script contains import matplotlib, I will receive an error. Is there a way to get my scripts to use Anaconda's version of Python instead?

我知道我可以在命令提示符下打開 Anaconda 的 Python 版本并手動導入它,但我想對我們進行設置,以便我可以雙擊 .py 文件和 Anaconda 的 Python 版本會自動使用.

I know that I can just open Anaconda's version of Python in the command prompt and manually import it, but I'd like to set things us so that I can just double-click on a .py file and Anaconda's version of Python is automatically used.

推薦答案

我知道這是舊的,但是如果您希望能夠雙擊 Python 文件并擁有正確的解釋器,這里的答案都不是真正的解決方案每次您想使用不同的解釋器時,無需修改 PYTHONPATHPATH 即可使用.當然,從命令行, activate my-environment 可以工作,但是 OP 專門詢問了雙擊.

I know this is old, but none of the answers here is a real solution if you want to be able to double-click Python files and have the correct interpreter used without modifying your PYTHONPATH or PATH every time you want to use a different interpreter. Sure, from the command line, activate my-environment works, but OP specifically asked about double-clicking.

在這種情況下,正確的做法是使用適用于 Windows 的 Python 啟動器.然后,您所要做的就是添加 #!path ointerpreterpython.exe 到腳本的頂部.不幸的是,雖然啟動器是 Python 3.3+ 的標準配置,但它不包含在 Anaconda 中(請參閱 Python & Windows:python 啟動器在哪里?),最簡單的做法是與 這里.

In this case, the correct thing to do is use the Python launcher for Windows. Then, all you have to do is add #! path ointerpreterpython.exe to the top of your script. Unfortunately, although the launcher comes standard with Python 3.3+, it is not included with Anaconda (see Python & Windows: Where is the python launcher?), and the simplest thing to do is to install it separately from here.

這篇關于如何使用 Anaconda 的 Python 版本執行 Python 腳本?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How to install Selenium in a conda environment?(如何在 conda 環境中安裝 Selenium?)
get the CUDA and CUDNN version on windows with Anaconda installe(使用 Anaconda installe 在 Windows 上獲取 CUDA 和 CUDNN 版本)
How can I download Anaconda for python 3.6(如何下載適用于 python 3.6 的 Anaconda)
Using two different Python Distributions(使用兩個不同的 Python 發行版)
How can I install Anaconda aside an existing pyenv installation on OSX?(除了 OSX 上現有的 pyenv 安裝之外,如何安裝 Anaconda?)
Permanently set Python path for Anaconda within Cygwin(在 Cygwin 中為 Anaconda 永久設置 Python 路徑)
主站蜘蛛池模板: 手机看黄av免费网址 | 欧美成人精品二区三区99精品 | 丝袜美腿一区二区三区 | 日韩高清国产一区在线 | 91看片网址| 一区二区视频在线观看 | 成人福利视频 | 日韩欧美精品 | 久草精品视频 | 中文二区| 99精品国产一区二区三区 | 春色av| 亚洲欧美日韩久久久 | 综合婷婷 | 国产麻豆乱码精品一区二区三区 | 国产日韩精品在线 | 欧美一区二区在线播放 | 亚洲一区二区在线电影 | 在线一区二区观看 | 九九热这里 | 一区二区三区av夏目彩春 | 亚洲男人天堂网 | 成人免费视频网站在线观看 | 亚洲精品99| 中文字幕日韩欧美 | 日韩精品av一区二区三区 | 久久久久久久久久久丰满 | 亚洲成人中文字幕 | 精品一区二区三区四区视频 | 一区二区三区高清不卡 | 欧美精品二区 | 精品国产一二三区 | 91福利在线观看 | 久久一级免费视频 | 国产精品永久免费 | 午夜影院在线 | 精品网站999www | 欧美一区永久视频免费观看 | 男女一区二区三区 | 精品久久亚洲 | 亚洲日本欧美日韩高观看 |