Ubuntu18.04环境下安装anaconda3

1.安装

1.1下载:https://www.anaconda.com/products/individual#linux

1.2安装:

bash Anaconda3-2019.03-Linux-x86_64.sh

一路回车,在合适位置按照提示输入yes;
在最后提示是否将该路径加入到环境里面,默认是No,建议输入yes

打开环境变量:

vim ~/.bashrc

查看新增的环境变量:

 再执行命令让.bashrc中添加的路径生效:

$ source ~/.bashrc 

运行python就可以看到已经安装好了,执行$ which python命令可以查看python路径:

2.打开

在base环境下输入(建议先看3.1):

anaconda-navigator

3.疑惑总结

3.1  为什么在上一张图中的开头有一个 (base)?

      答:查看环境变量会发现,aconda自动加入了命令到 .bashrc中,  在我们打开终端的时候自动执行了  

conda  activate base 命令,而在其他用户下就不会出现(base).

          怎么解除嘞?设置为false即可

conda config --set auto_activate_base false

                再次进入base环境:

conda activate

3.2 使用jupyter

主页面:(是不是很熟悉?)

 真巧:

 显示的就是你的家目录,通过8888端口访问你的家目录,好像这个可以设置登录密码,然后可以实现远程登录,但我没有研究(-_-)

这样,新生成的文件应该知道去哪里找了吧。

 3.3 一次性升级anaconda3中所有包

conda update --all

 3.4 出现"OneHotEncoder" object has no attribute 'Transform'  报错

       答:更换spark版本就好,3.0不支持,2.4.5就可以

3.5 可不可以在window下配置安装anaconda3  并且同时可以使用pysaprk?

    答:当然可以。 前提 jdk1.8  . 

附jdk1.8链接:

链接:https://pan.baidu.com/s/1M8HK_LTjuyt2CEF1x67Sgg
提取码:ro13

    在命令窗口输入:

conda install pyspark

3.6 “NotWritableError: The current user does not have write permissions to a required path”

Collecting package metadata (current_repodata.json): failed

NotWritableError: The current user does not have write permissions to a required path.
  path: /home/peco/.conda/pkgs/urls.txt
  uid: 1000
  gid: 1000

If you feel that permissions on this path are set incorrectly, you can manually
change them by executing

  $ sudo chown 1000:1000 /home/peco/.conda/pkgs/urls.txt

In general, it's not advisable to use 'sudo conda'.

  NotWritableError :The current user does nit have write permissions to a required to path

    错误的中文意思是:无法写入错误:当前的用户没有写入到该路径文件的权限

    解决:

sodo chown -R msq anaconda3

  

参考博客:

https://blog.csdn.net/weixin_43142797/article/details/98027080

https://blog.csdn.net/weixin_43142797/article/details/98463569

https://blog.csdn.net/OTZ_2333/article/details/86688480

https://blog.csdn.net/yyxyyx10/article/details/94741871

https://blog.csdn.net/PecoHe/article/details/104578700

原文地址:https://www.cnblogs.com/msq2000/p/13056177.html