Jupyter和本地计算机使用的python位于不同的位置 [英] The python used by Jupyter and local machine are in different place

查看:141
本文介绍了Jupyter和本地计算机使用的python位于不同的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Jupyter的新手,我发现无法导入其模块.我找到了答案,因为我的Jupyter使用的Python与我的本地计算机使用的Python不同. 这是我在Jupyter上运行sys.executable时的输出:

I am new to Jupyter, and I found I can not import module on it. I found the answer said because the Python my Jupyter using is different from the Python my local machine using. This is the output when I run sys.executable on Jupyter:

import sys
sys.executable
'/usr/local/Cellar/jupyterlab/1.2.4/libexec/bin/python3.7'

这是我本地计算机终端上的输出

This is the output on my local machine's terminal

import sys
>>> sys.executable
'/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python'

我不知道如何解决它,我想使用Jupyter.任何建议都可能会有所帮助.

I have no idea how to fix it, I want to use Jupyter. Any advice may be helpful.

谢谢.

推荐答案

我通过在计算机上安装Anaconda并打开Anaconda应用程序并启动Jupyter来解决此问题.目前的环境是

I fixed this issue by install Anaconda on my machine, and open the Anaconda app, launch Jupyter. At this time the environment is

'/Users/saber/opt/anaconda3/bin/python'

我认为我的笔记本电脑中可能有3个版本的Python,但我不知道如何删除它们,只保留所有它们(希望它们不会杀死我可怜的128G存储空间).

I think maybe there are 3 versions of Python in my laptop, but I have no idea how to delete them, just keep all of them (hope they do not kill my poor storage 128G).

参考: Anaconda教程 在Mac上安装Anaconda

这篇关于Jupyter和本地计算机使用的python位于不同的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆