MAC 使用问题汇总

1. 在.zshrc中添加的环境变量不起作用

Answer: 需要把/etc/zshrc文件复制到 ~, 并命名为.zshrc,然后设置环境变量即可;

2. 创建python虚拟环境

    python3 -m venv myvenv

   2.1 python安装:pyenv install 3.12.3

   2.2 python设置全局:pyenv global 3.12.3

  2.3 在项目中使用特定版本: 在项目目录下,创建一个 .python-version 文件,内容为 3.12.3

     echo 3.12.3 > .python-version;进入项目目录后,pyenv 会自动切换到指定的Python版本

3. U 盘启动制作

terminal输入: sudo /Applications/Install\ macOS\ Ventura.app/contents/Resources/createinstallmedia --volume /Volumes/MyVolume

Error: Error Domain=NSCocoaErrorDomain Code=513 "未能拷贝“安装macOS Ventura”,因为你没有访问“Install macOS Ventura”的许可。" UserInfo={NSSourceFilePathErrorKey=/Applications/Install macOS Ventura.app, NSUserStringVariant=(   Copy ), NSDestinationFilePath=/Volumes/Install macOS Ventura/Install macOS Ventura.app, NSFilePath=/Applications/Install macOS Ventura.app, NSUnderlyingError=0x60000393f600 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}The copy of the installer app failed.

The bless of the installer disk failed.

原因:

输入的createinstallmedia目录路径不正确,contents应为大些,与实际路径要完全一致,

修改为:sudo /Applications/InstallmacOSVentura.app/Contents/Resources/createinstallmedia --volume /Volumes/MyVolume, 问题解决;

4. Homebrew 国内安装:

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

5. mac下无法安装pypdf2

Could not fetch URL https://pypi.org/simple/pypdf2/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pypdf2/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

解决方法:

brew install openssl

posted @ 2025-01-07 13:13  jiguanghover  阅读(67)  评论(0)    收藏  举报