Virtualenv 使用

使用如下命令进行安装 $ pip install virtualenv 创建目录: tabtu:~$mkdir pythonV tabtu:~$cd pythonV/ tabtu:pythonV$ 创建一个独立的Python运行环境,命名为venv: virtualenv venv (when higher than 3.8) virtualenv -–no-site-packages venv tabtu:pythonV$virtualenv –no-site-packages venv Using base prefix ‘/Library/Frameworks/Python.framework/Versions/3.6’ New python executable in /Users/tabtu/pythonV/venv/bin/python3.6 Also creating executable in /Users/tabtu/pythonV/venv/bin/python Installing setuptools, pip, wheel…done. tabtu:pythonV$ tabtu:pythonV$ls venv tabtu:venv$ls bin include lib pip-selfcheck.json tabtu:venv$ tabtu:venv$ 命令virtualenv就可以创建一个独立的Python运行环境,我们还加上了参数–no-site-packages,这样,已经安装到系统Python环境中的所有第三方包都不会复制过来,这样,我们就得到了一个不带任何第三方包的“干净”的Python运行环境。 进入独立的venv环境目录下: 新建的Python环境被放到当前目录下的venv目录。有了venv这个Python环境,可以用source进入该环境: …

started Docker for Mac

# 获取版本信息 $ docker version $ docker info # service 命令的用法 $ sudo service docker start # systemctl 命令的用法 $ sudo systemctl start docker $ docker image pull library/hello-world $ docker image pull hello-world $ docker image pull ubuntu $ docker image ls -a $ docker image rm ubuntu $ docker container run ubuntu $ docker container rm ubuntu $ docker container kill ubuntu $ docker container ls -a $ docker container run -p 8000:3000 -it koa-demo:0.0.1 /bin/bash https://docs.docker.com/docker-for-mac/ …

Installing Bazel on macOS

Install Bazel on macOS using one of the following methods: Use the binary installer (recommended) Use Homebrew Compile Bazel from source Bazel comes with two completion scripts. After installing Bazel, you can: Access the bash completion script Install the zsh completion script Installing using binary installer The binary installers are on Bazel’s GitHub releases page. The installer contains …

Terminal显示颜色设置

#Set ls Color export CLICOLOR=1 export LSCOLORS=exfxaxdxbxegedabagacad RGB: 199, 237, 204 对于从Unix/Linux平台转到Mac的同学来说,“终端”是经常要使用的一个工具。不过可能有很多人已经发现了,当我们使用ls命令来显示目录内容的时候,“终端”对于目录、可执行文件等特殊类型的文件并没有使用颜色来显示,只有使用“ls -G”时,才能显示颜色,这可真是不方便啊。有没有方法可以默认显示颜色呢?方法当然有。 方案一 第一个方案是让ls自动变成ls -G。我们要在用户目录下(~)创建一个名为.bash_profile的文件,如果这个文件已经存在,我们直接编辑这个文件就可以了。在~/.bash_profile中加入下面的内容: alias ls=”ls -G” 保存文件后,重新启动“终端”。这时,运行ls命令,我们就可以看到文件已经可以用彩色来显示了。 方案二 上面这个方案虽然解决了彩色显示问题,但是还有一点不足,就是无法设置显示的颜色。比如说,我想用红色显示目录,那么这种方法是做不到的。下面我们来看看一个更好的解决方案。同样是修改~/.bash_profile文件,在文件中加入下面两行配置。 export CLICOLOR=1 export LSCOLORS=gxfxaxdxcxegedabagacad 保存文件,重新运行“终端”,我们发现目录的颜色由蓝色变成了青色。 配置 那么应该怎样来配置成我喜欢的颜色呢?下面我们就来详细说一些这些配置。 ~/.bash_profile是bash shell中当前登录用户的配置文件。bash是“终端”中默认的shell。 alias ls=”ls -G”是给”ls -G”起了一个别名,当执行ls时,就相当于执行了ls -G。 CLICOLOR是用来设置是否进行颜色的显示。CLI是Command Line Interface的缩写。 LSCOLORS是用来设置当CLICOLOR被启用后,各种文件类型的颜色。LSCOLORS的值中每两个字母为一组,分别设置某个文件类型的文字颜色和背景颜色。 LSCOLORS中一共11组颜色设置,按照先后顺序,分别对以下的文件类型进行设置: directory symbolic link socket pipe executable block special character special executable with setuid bit …