一、MAC应用安装
1、常用软件地址
https://www.macwk.com
2、常见问题
https://stackoverflow.com
3、HomeBrew
mac安装brew方式/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"、、、电脑系统版本:11.3All user-space services OK, nothing cleaned...==> brew update-reset==> Fetching usr/local/Homebrew...==> Resetting usr/local/Homebrew...Branch 'master' set up to track remote branch 'master' from 'origin'.Reset branch 'master'Your branch is up to date with 'origin/master'.==> Fetching usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask...==> Resetting usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask...Branch 'master' set up to track remote branch 'master' from 'origin'.Reset branch 'master'Your branch is up to date with 'origin/master'.==> Fetching usr/local/Homebrew/Library/Taps/homebrew/homebrew-core...==> Resetting usr/local/Homebrew/Library/Taps/homebrew/homebrew-core...Updating files: 100% (5721/5721), done.Branch 'master' set up to track remote branch 'master' from 'origin'.Reset branch 'master'Your branch is up to date with 'origin/master'.==> Fetching usr/local/Homebrew/Library/Taps/homebrew/homebrew-services...==> Resetting usr/local/Homebrew/Library/Taps/homebrew/homebrew-services...Branch 'master' set up to track remote branch 'master' from 'origin'.Reset branch 'master'Your branch is up to date with 'origin/master'.Brew自动安装程序运行完成国内地址已经配置完成桌面的Old_Homebrew文件夹,大致看看没有你需要的可以删除。初步介绍几个brew命令本地软件库列表:brew ls查找软件:brew search google(其中google替换为要查找的关键字)查看brew版本:brew -v 更新brew版本:brew update安装cask软件:brew install --cask firefox 把firefox换成你要安装的欢迎右键点击下方地址-打开URL 来给点个赞https://zhuanlan.zhihu.com/p/111014448重启终端 或者 运行 source Users/erwei.zheng/.zprofile 否则可能无法使用、、、
4、docker
官方下载地址:https://docs.docker.com/get-docker/
Mac OS系统如何通过Docker安装Oracle11g
Mac OS 系统如何通过docker安装Oracle11g一、下载并安装dockerhttps://docs.docker.com/get-docker/二、通过Docker来安装Oracle11g1、Docker是一个容器,在容器内部存在很多的镜像文件,通过具体的镜像文件可以运行具体的容器。要想在Docker中安装Oracle镜像,我们首先应该在Docker的远程仓库中进行搜索,因为Docker没有自带Oracle相关镜像,命令如下:sudo docker search docker-oracle-xe-11g、、、localhost:~ erwei.zheng$ sudo docker search docker-oracle-xe-11gNAME DESCRIPTION STARS OFFICIAL AUTOMATEDdeepdiver/docker-oracle-xe-11g 40 [OK]epiclabs/docker-oracle-xe-11g Customized Oracle XE 11g build for CI and de… 20 [OK]pengbai/docker-oracle-xe-11g-r2 oracle xe 11g r2 with sql initdb and web con… 10 [OK]arahman/docker-oracle-xe-11g phusion/baseimage based spin off of alexei-l… 9 [OK]konnecteam/docker-oracle-xe-11g Fork of https://github.com/wnameless/docker-… 3 [OK]rafaelri/docker-oracle-xe-11g Fork from wnameless/docker-oracle-xe-11g 3 [OK]ignatov/docker-oracle-xe-11g Dockerfile of Oracle Database Express Editio… 3 [OK]gswteam/docker-oracle-xe-11g Oracle XE 11g 0 [OK]jeromefromcn/docker-oracle-xe-11g docker-oracle-xe-11g 0 [OK]nguoianphu/docker-oracle-xe-11g Oracle Express Edition 11g Release 2 on Ubun… 0 [OK]lynxsolutions/docker-oracle-xe-11g docker-oracle-xe-11g 0 [OK]zzzfree/docker-oracle-xe-11g docker-oracle-xe-11g 0 [OK]deadok22/docker-oracle-xe-11g docker-oracle-xe-11g 0rdehuyss/docker-oracle-xe-11g Oracle Express 11g R2 on Ubuntu 14.04.2 LTS 0 [OK]dbanttari/docker-oracle-xe-11g Branch of wnameless/docker-oracle-xe-11g tha… 0 [OK]xtechnologies/docker-oracle-xe-11g docker-oracle-xe-11g 0 [OK]bizybot/docker-oracle-xe-11g wnameless/docker-oracle-xe-11g 0 [OK]cheyu0325/docker-oracle-xe-11g docker-oracle-xe-11g 0kikicarbonell/docker-oracle-xe-11g Docker image of Oracle Database Express Edit… 0 [OK]ceagan/docker-oracle-xe-11g Modified version of wnameless/docker-oracle-… 0 [OK]zigac/docker-oracle-xe-11g Oracle xe 11g 0 [OK]dockerbolcom/docker-oracle-xe-11g Fork of https://github.com/wnameless/docker-… 0 [OK]demers/docker-oracle-xe-11g-spark Oracle XE 11g with Spark 0gmartsenkov/docker-oracle-xe-11g oracle 0 [OK]demers/docker-oracle-xe-11g Docker Oracle 11g XE with Java 13 and Python… 0localhost:~ erwei.zheng$ sudo docker search docker-oracle-19c、、、2、选择第一个STAR最多的镜像进行安装,拉取镜像命令如下:localhost:~ erwei.zheng$ sudo docker pull deepdiver/docker-oracle-xe-11g、、、localhost:~ erwei.zheng$ sudo docker pull deepdiver/docker-oracle-xe-11gUsing default tag: latestlatest: Pulling from deepdiver/docker-oracle-xe-11gImage docker.io/deepdiver/docker-oracle-xe-11g:latest uses outdated schema1 manifest format. Please upgrade to a schema2 image for better future compatibility. More information at https://docs.docker.com/registry/spec/deprecated-schema-v1/a3ed95caeb02: Pulling fs layer9cf7e98c567b: Pulling fs layerd2ff49536f4d: Pulling fs layerf94adccdbb9c: Waitingee950bf8af06: Waitingeec0023b823a: Waiting2bbcf2933a57: Pull complete1d639c2160a1: Pull complete2631aa3055c3: Pull completed859f4b0261f: Pull complete344fe8edcc0a: Pull complete48fec8d59976: Pull completec9c81ef7960f: Pull complete7e928eb7228a: Pull complete56e977b47ad6: Pull complete5c896b34601c: Pull completebcab6dcbd345: Pull complete42e031cc37c0: Pull completefd6c6b47d0ba: Pull complete546a383ffbe3: Pull complete5acead7005d0: Pull complete206b7448a401: Pull completebdf584565438: Pull complete4ce7a34d8c4b: Pull complete8702b3ee1143: Pull complete777d696e58cd: Pull complete8271d90e318b: Pull completec0e2d1590154: Pull completeaeb67e38d18e: Pull completeDigest: sha256:30c9b1f61397bbca016c25b21c4c2e5399af225306e41272874411ae2bd741d3Status: Downloaded newer image for deepdiver/docker-oracle-xe-11g:latestdocker.io/deepdiver/docker-oracle-xe-11g:latest、、、3、待镜像下载完毕之后,我们需要将该镜像转成容器并使用该容器,命令如下:sudo docker run -d -p 1521:1521 --name oracle11g deepdiver/docker-oracle-xe-11g、、、localhost:~ erwei.zheng$ sudo docker run -d -p 1521:1521 --name oracle11g deepdiver/docker-oracle-xe-11gPassword:2b6e39d1b126ddbf42f9ddd14c6510ad2dfcb50082fe0fb7954e566a32a3443c、、、值得注意的就是将容器内部的1521端口映射到宿主机中的1521端口,这样一来就能在宿主机中通过Navicat等数据库可视化管理工具进行连接了。在这步完成之后,我们需要进到荣日内部对已经安装的Oracle进行简单配置4、在Oracle容器中简单配置你的Oracle数据库并通过Navicat进行连接进入容器内部的命令如下:1>查询容器ID --2b6e39d1b126docker ps、、、bogon:~ erwei.zheng$ docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES2b6e39d1b126 deepdiver/docker-oracle-xe-11g "/bin/sh -c 'sed -i …" 4 hours ago Up 4 hours 22/tcp, 8080/tcp, 0.0.0.0:1521->1521/tcp, :::1521->1521/tcp oracle11g、、、2>进入容器sudo docker exec -it 你的容器ID(可通过docker ps 命令获得) bin/bash、、、bogon:~ erwei.zheng$ sudo docker exec -it 2b6e39d1b126 bin/bashPassword:root@2b6e39d1b126:/#、、、3>通过sqlplus进入Oraclesqlplus system/oracle、、、root@2b6e39d1b126:/# sqlplus system/oracleSQL*Plus: Release 11.2.0.2.0 Production on Sun Jul 4 09:39:02 2021Copyright (c) 1982, 2011, Oracle. All rights reserved.ERROR:ORA-28002: the password will expire within 7 daysConnected to:Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit ProductionSQL>、、、依次进行如下操作:查看数据库用户名和密码:select username, password from dba_users;、、、Connected to:Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit ProductionSQL> select username, password from dba_users;USERNAME PASSWORD------------------------------ ------------------------------SYSGCSANONYMOUSAUTOTESTSYSTEMAPEX_PUBLIC_USERAPEX_040000XS$NULLOUTLNXDBCTXSYSUSERNAME PASSWORD------------------------------ ------------------------------MDSYSFLOWS_FILESHR14 rows selected.可以使用已经存在的用户名和密码来登陆数据库,推荐使用新创建的用户来进行数据库的登陆,sql如下:create user 用户名 identified by 密码;、、、SQL> create user gcs identified by gcs;User created.、、、创建完后,可以通过如下sql进行验证:select * form all_users;对新创建的用户进行授权,sql如下:grant connect, resource to GCSHS; -- 这里需要将用户名大写,否则授权不成功-- connect表示具有连接数据库的权限;resource表示具有操作数据库的权限;、、、SQL> grant connect, resource to GCSHS;Grant succeeded.、、、至此,所有需要配置的数据库配置都已经配置完毕,可以通过Navicat进行连接了,navicat创建连接注意事项:connection name: 随便connection type: basichost:localhost 或 127.0.0.1port:1521 -- 端口为docker内部Oracle容器映射到宿主机的端口,上述命令有将1521端口映射到宿主机的1521端口service name:XErole:defaultusername:gcspassword:gcs配置完后,可进行连接测试;参考连接:https://blog.csdn.net/qq_36314960/article/details/100111935?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522162532422716780366582422%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=162532422716780366582422&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduend~default-1-100111935.first_rank_v2_pc_rank_v29&utm_term=mac%E5%AE%89%E8%A3%85oracle%E6%95%B0%E6%8D%AE%E5%BA%93&spm=1018.2226.3001.4187问题:重启docker或者重启电脑后,使用docker ps命令看重启前的oracle容器ID:使用命令查看被stop的容器id:docker ps -a、、、localhost:~ erwei.zheng$ docker ps -aCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES2b6e39d1b126 deepdiver/docker-oracle-xe-11g "/bin/sh -c 'sed -i …" 5 hours ago Exited (255) 12 minutes ago 22/tcp, 8080/tcp, 0.0.0.0:1521->1521/tcp, :::1521->1521/tcp oracle11g、、、重启被stop的容器id:Docker start id(通过docker ps -a 查看停止运行的容器id)或者docker restart id、、、localhost:~ erwei.zheng$ docker ps -aCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES2b6e39d1b126 deepdiver/docker-oracle-xe-11g "/bin/sh -c 'sed -i …" 5 hours ago Exited (137) About a minute ago oracle11glocalhost:~ erwei.zheng$ docker restart 2b6e39d1b1262b6e39d1b126localhost:~ erwei.zheng$ docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES2b6e39d1b126 deepdiver/docker-oracle-xe-11g "/bin/sh -c 'sed -i …" 5 hours ago Up 6 seconds 22/tcp, 8080/tcp, 0.0.0.0:1521->1521/tcp, :::1521->1521/tcp oracle11glocalhost:~ erwei.zheng$、、、
4、.bash_profile 环境变量
Mac使用HomeBrew安装python3.*并设置为默认版本
Mac使用HomeBrew安装python3.*并设置为默认版本一、安装1、查看Mac自带的python版本python2、查看python3的安装包brew search python33、安装python3brew install python3==> CaveatsPython has been installed asusr/local/bin/python3Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to`python3`, `python3-config`, `pip3` etc., respectively, have been installed intousr/local/opt/python@3.9/libexec/binYou can install Python packages withpip3 install <package>They will install into the site-package directoryusr/local/lib/python3.9/site-packagestkinter is no longer included with this formula, but it is available separately:brew install python-tk@3.9See: https://docs.brew.sh/Homebrew-and-Python==> Summary🍺 usr/local/Cellar/python@3.9/3.9.6: 3,078 files, 54.6MB==> Caveats==> python@3.9Python has been installed asusr/local/bin/python3Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to`python3`, `python3-config`, `pip3` etc., respectively, have been installed intousr/local/opt/python@3.9/libexec/bin# 可以看到python3的世界安装目录是/usr/local/Cellar/python@3.9/3.9.6# 配置python的外部环境变量1、打开配置文件并写入python外部环境变量open ~/.bash_profileexport PATH=${PATH}:/usr/local/Cellar/python@3.9/3.9.6/bin2、重命名pythonalias python="/usr/local/Cellar/python@3.9/3.9.6/bin/python3.9"3、让配置文件生效source ~/.bash_profile4、使用python命令查看pythonmac pro 环境变量的配置 (当不存在 .bash_profile 文件的时候)
mac pro 环境变量的配置 (当不存在 .bash_profile 文件的时候)1、启动终端terminal2、进入当前用户的home目录(/user/erwei.zheng)输入 cd ~、、、# 查看home目录下的所有文件和文件夹localhost:~ erwei.zheng$ ls -a、、、3、创建.bash_profile文件输入 touch .bash_profile4、编辑 .bash_profile文件,打开后编辑文件,配置环境变量输入 open -e .bash_profile5、保存文件,关闭 .bash_profileCommand + s 保存6、更新刚配置的环境变量输入 source .bash_profile7、验证配置是否成功输入python、、、# 以python3为例,配置环境变量# python3的安装目录是/usr/local/Cellar/python@3.9/3.9.6# 配置python的外部环境变量1、打开配置文件并写入python外部环境变量open ~/.bash_profileexport PATH=${PATH}:/usr/local/Cellar/python@3.9/3.9.6/bin2、重命名pythonalias python="/usr/local/Cellar/python@3.9/3.9.6/bin/python3.9"3、让配置文件生效source ~/.bash_profile4、使用python命令查看python、、、
5、cx_Oracle
pip安装:sudo pip3 install cx_Oracle
localhost:~ erwei.zheng$ sudo pip3 install cx_OraclePassword:WARNING: The directory '/Users/erwei.zheng/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.Collecting cx_OracleDownloading cx_Oracle-8.2.1.tar.gz (359 kB)|████████████████████████████████| 359 kB 29 kB/sInstalling build dependencies ... doneGetting requirements to build wheel ... donePreparing wheel metadata ... doneBuilding wheels for collected packages: cx-OracleBuilding wheel for cx-Oracle (PEP 517) ... doneCreated wheel for cx-Oracle: filename=cx_Oracle-8.2.1-cp39-cp39-macosx_11_0_x86_64.whl size=185941 sha256=000cf3f949a48c1680ab91ea7af700e8422275d80fc3c86caa60de0d8bc7013dStored in directory: /private/tmp/pip-ephem-wheel-cache-rkoifbul/wheels/0c/ad/1b/d206b2ada8e1381a02024ef67608cf919b5cd025cc24f38faaSuccessfully built cx-OracleInstalling collected packages: cx-OracleSuccessfully installed cx-Oracle-8.2.1WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venvlocalhost:~ erwei.zheng$
问题:cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit OracleClientlibrary: "dlopen(/opt/oracle/instantclient_11_2/lib/libclntsh.dylib, 1): image not found".
MacOS cx_Oracle.DatabaseError: DPI-1047: 64-bit Oracle Client library cannot be loaded: 解决方案问题:cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library: "dlopen(/opt/oracle/instantclient_11_2/lib/libclntsh.dylib, 1): image not found".https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html、、、instantclient-basic-macos.x64-19.8.0.0.0dbru.zip 客户端软件对应的Oracle数据库版本:参考官网:https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.htmlVersion 21 client libraries can connect to Oracle Database 12.1 or greater. Version 19, 18 and 12.2 client libraries can connect to Oracle Database 11.2 or greater. Version 12.1 client libraries can connect to Oracle Database 10.2 or greater. Version 11.2 client libraries can connect to Oracle Database 9.2 or greater.、、、、、、客户端软件下载地址:https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html、、、准备工作:下载 instant client 客户端,客户端与oracle数据库版本对照关系见上面网站开始设置:1、创建文件夹,并将压缩包解压到这个文件夹下mkdir -p /opt/oracle— 将客户端文件拷贝到 /opt/oracle目录下cp instantclient-basic-macos.x64-19.8.0.0.0dbru.zip /opt/oracle—- cd当前路径到 /opt/oracle/下— 解压客户端压缩包到当前目录Unzip instantclient-basic-macos.x64-19.8.0.0.0dbru.zip2、创建超链接,以使应用程序能够找到该库mkdir ~/libsudo unzip instantclient-basic-macos.x64-19.8.0.0.0dbru.zip3、将instan client 路径添加到环境变量中open -e .bash_profile4、保存文件后,更新刚配置的环境变量source .bash_profile
pycharm2019.3 python报错:ModuleNotFoundError- No module named 'cx_Oracle'.rtf
pycharm2019.3 python报错:ModuleNotFoundError: No module named 'cx_Oracle'Pycharm 设置问题,更新配置即可步骤:file-setting-project:xxx,如下:选择add选择system interpreter ,后目录会自动更新到你python安装目录下的解释器python.exe。点击确定即可。
文章转载自amazingweiwei,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




