wsl

作者: royluck | 来源:发表于2021-04-28 09:53 被阅读0次

    bash
    cat /etc/issue

    • vscode有分两种打开方式:
      1:执行bash进入wsl环境,再执行code .此时会自动启动vscode,但是这时候打开的vscode,它的目录和环境指向是ubuntu
      参考1
      2:window环境直接打开vscode,这时的目录和环境指向是window

      这样我们可以直接在window目录下,使用wsl的运行环境
    • ubuntu 18.04LTS默认装了 python -V打印Python 3.6.9

    • su root 以root的身份登录到系统里面

    • 更新镜像源:

    • 参考1:http://www.bdnetlab.com/?p=981

    • 参考2: https://www.cnblogs.com/pealicx/p/10614612.html

    • 用迅雷从[https://www.python.org/ftp/python/](https://www.python.org/ftp/python/)下载对应python版本

    • sudo cp /mnt/e/Python-3.7.9.tar.xz /usr/local/python3/Python-3.7.9.tar.xz

    • cd /usr/local/python3

    • tar -xvJf Python-3.7.9.tar.xz

    • cd Python-3.7.9

    • sudo ./configure --prefix=/usr/local/python3 --with-ssl

    • 问题:WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python
      is not available.

    • make && make install

    • 创建软链接:
      ln -s /usr/local/python3/bin/python3 /usr/bin/python3.7
      ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3.7

    • 把python和pip指令,默认指向/usr/local/python3/bin/pip3和python3:
      ln -s /usr/local/python3/bin/python3 /usr/bin/python
      ln -s /usr/local/python3/bin/pip3 /usr/bin/pip


    linux相关指令:


    C:\Users\Administrator\anaconda3
    C:\Users\Administrator\anaconda3\Scripts
    C:\Users\Administrator\anaconda3\Library\bin
    C:\Users\Administrator\anaconda3\Library\mingw-w64\bin
    

    安装pandas各种奇怪问题:

    对于ubuntu: sudo apt-get install liblzma-dev

    对于centos:yum install -y xz-devel

    然后 configure && make && make install

    相关文章

      网友评论

          本文标题:wsl

          本文链接:https://www.haomeiwen.com/subject/bjtgzktx.html