XX-net / XX-Net

A proxy tool to bypass GFW.
33.01k stars 7.7k forks source link

安装完xcode就无法启动是什么原因呢? #13606

Open imagem007 opened 2 years ago

imagem007 commented 2 years ago

Macbook pro,不做开发,但有时候总会因为要解决某个问题,不得不安装一下Xcode。 安装后,用start启动xx-net,终端就提示输入密码,然后下载一堆东西,完成后就没有任何反应了。不会打开网页端设置界面,菜单栏也不会出现图标。 卸载Xcode,重启,恢复正常。

之前系统是MacOS Catalina,每次安装Xcode都会有上述问题。 最近更新了Monterey,并因为某个原因,把python升级到3.10,安装Xcode后还是会导致xx-net不能启动。 卸载Xcode,python恢复到2.7.9,重启后,xx-net恢复正常。

xxnet commented 2 years ago

你可以在命令行下执行 ./start 看看输出什么信息,如果解决不了就把日志贴出来

imagem007 commented 2 years ago

再一次尝试安装Xcode后,第一次在终端中运行./start的结果(省略了xcode协议文本、大段的类似的下载安装指令) Last login: Sat Oct 30 12:05:09 on ttys000 i007@MP ~ % cd /Applications/XX-Net i007@MP XX-Net % ./start XX-Net version:4.5.4 Run XX-Net in background. i007@MP XX-Net % cd /Applications/XX-Net i007@MP XX-Net % ./start XX-Net version:4.5.4

You have not agreed to the Xcode license agreements. You must agree to both license agreements below in order to use Xcode.

Press the 'return' key to view the license agreements at '/Applications/Xcode.app/Contents/Resources/English.lproj/License.rtf'

Xcode and Apple SDKs Agreement

PLEASE SCROLL DOWN AND READ ALL OF THE FOLLOWING TERMS AND CONDITIONS CAREFULLY BEFORE USING THE APPLE SOFTWARE OR APPLE SERVICES.

......

EA1647 8/7/2019 Password:

You have not agreed to the Xcode license agreements. You must agree to both license agreements below in order to use Xcode.

Press the 'return' key to view the license agreements at '/Applications/Xcode.app/Contents/Resources/English.lproj/License.rtf'

Xcode and Apple SDKs Agreement

PLEASE SCROLL DOWN AND READ ALL OF THE FOLLOWING TERMS AND CONDITIONS CAREFULLY BEFORE USING THE APPLE SOFTWARE OR APPLE SERVICES.

......

EA1647 8/7/2019

By typing 'agree' you are agreeing to the terms of the software license agreements. Type 'print' to print them or anything else to cancel, [agree, print, cancel] agree

You can view the license agreements in Xcode's About Box, or at /Applications/Xcode.app/Contents/Resources/English.lproj/License.rtf

WARNING: The directory '/Users/i007/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 may want sudo's -H flag. Collecting pyOpenSSL Downloading pyOpenSSL-21.0.0-py2.py3-none-any.whl (55 kB) |████████████████████████████████| 55 kB 703 kB/s Collecting cryptography>=3.3 Downloading cryptography-35.0.0.tar.gz (559 kB) |████████████████████████████████| 559 kB 651 kB/s Installing build dependencies ... done Getting requirements to build wheel ... done Preparing wheel metadata ... done Requirement already satisfied: six>=1.5.2 in /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages (from pyOpenSSL) (1.15.0) Collecting cffi>=1.12 Downloading cffi-1.15.0.tar.gz (484 kB) |████████████████████████████████| 484 kB 874 kB/s Collecting pycparser Downloading pycparser-2.20-py2.py3-none-any.whl (112 kB) |████████████████████████████████| 112 kB 484 kB/s Building wheels for collected packages: cryptography, cffi Building wheel for cryptography (PEP 517) ... error ERROR: Command errored out with exit status 1: command: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpcp38ww3d cwd: /private/tmp/pip-install-564o8ubp/cryptography Complete output (166 lines): running bdist_wheel running build running build_py creating build creating build/lib.macosx-10.14-x86_64-3.8 creating build/lib.macosx-10.14-x86_64-3.8/cryptography copying src/cryptography/init.py -> build/lib.macosx-10.14-x86_64-3.8/cryptography copying src/cryptography/utils.py -> build/lib.macosx-10.14-x86_64-3.8/cryptography

......

running egg_info writing src/cryptography.egg-info/PKG-INFO writing dependency_links to src/cryptography.egg-info/dependency_links.txt writing requirements to src/cryptography.egg-info/requires.txt writing top-level names to src/cryptography.egg-info/top_level.txt reading manifest file 'src/cryptography.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' no previously-included directories found matching 'docs/_build' warning: no previously-included files found matching 'vectors' .......

writing manifest file 'src/cryptography.egg-info/SOURCES.txt' copying src/cryptography/py.typed -> build/lib.macosx-10.14-x86_64-3.8/cryptography creating build/lib.macosx-10.14-x86_64-3.8/cryptography/hazmat/bindings/_rust copying src/cryptography/hazmat/bindings/_rust/init.pyi -> build/lib.macosx-10.14-x86_64-3.8/cryptography/hazmat/bindings/_rust copying src/cryptography/hazmat/bindings/_rust/asn1.pyi -> build/lib.macosx-10.14-x86_64-3.8/cryptography/hazmat/bindings/_rust copying src/cryptography/hazmat/bindings/_rust/ocsp.pyi -> build/lib.macosx-10.14-x86_64-3.8/cryptography/hazmat/bindings/_rust copying src/cryptography/hazmat/bindings/_rust/x509.pyi -> build/lib.macosx-10.14-x86_64-3.8/cryptography/hazmat/bindings/_rust running build_ext generating cffi module 'build/temp.macosx-10.14-x86_64-3.8/_openssl.c' creating build/temp.macosx-10.14-x86_64-3.8 running build_rust

  =============================DEBUG ASSISTANCE=============================
  If you are seeing a compilation error please try the following steps to
  successfully install cryptography:
  1) Upgrade to the latest pip and try again. This will fix errors for most
     users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
  2) Read https://cryptography.io/en/latest/installation/ for specific
     instructions for your platform.
  3) Check our frequently asked questions for more information:
     https://cryptography.io/en/latest/faq/
  4) Ensure you have a recent Rust toolchain installed:
     https://cryptography.io/en/latest/installation/#rust

  Python: 3.8.9
  platform: macOS-12.0.1-x86_64-i386-64bit
  pip: 20.2.3
  setuptools: 49.2.1
  setuptools_rust: 0.12.1
  =============================DEBUG ASSISTANCE=============================

error: can't find Rust compiler

If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.

To update pip, run:

  pip install --upgrade pip

and then retry package installation.

If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.

This package requires Rust >=1.41.0.

ERROR: Failed building wheel for cryptography Building wheel for cffi (setup.py) ... done Created wheel for cffi: filename=cffi-1.15.0-cp38-cp38-macosx_10_14_x86_64.whl size=258764 sha256=df057c946bbb1b106616fb4dc0102dbcef44039b391fc54565198b4c01be3bd4 Stored in directory: /private/tmp/pip-ephem-wheel-cache-yffcnjxv/wheels/a4/cb/1a/277a076c4434fadc0707a37ba48587dc2ac6397d517c3b9de7 Successfully built cffi Failed to build cryptography ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly WARNING: You are using pip version 20.2.3; however, version 21.3.1 is available. You should consider upgrading via the '/Applications/Xcode.app/Contents/Developer/usr/bin/python3 -m pip install --upgrade pip' command. Run XX-Net in background. i007@MP XX-Net %

imagem007 commented 2 years ago

第二次在终端运行./start的结果(同样省略了大段类似的下载安装的过程) i007@MP XX-Net % ./start

XX-Net version:4.5.4

Password:

WARNING: The directory '/Users/i007/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 pyOpenSSL

Downloading pyOpenSSL-21.0.0-py2.py3-none-any.whl (55 kB)

|████████████████████████████████| 55 kB 509 kB/s

.......

Installing collected packages: pycparser, ....... cffi, six, cryptography, pyOpenSSL

Successfully installed cffi-1.15.0 cryptography-35.0.0 ....... pyOpenSSL-21.0.0 pycparser-2.20 six-1.16.0

WARNING: 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/venv

WARNING: You are using pip version 21.2.3; however, version 21.3.1 is available.

You should consider upgrading via the '/Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10 -m pip install --upgrade pip' command.

WARNING: The directory '/Users/i007/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 PyObjC

Downloading pyobjc-7.3-py3-none-any.whl (3.0 kB)

Collecting Pillow

Downloading Pillow-8.4.0-cp310-cp310-macosx_10_10_universal2.whl (3.0 MB)

|████████████████████████████████| 3.0 MB 47 kB/s

……

Installing collected packages: pyobjc-core, ……

Successfully installed Pillow-8.4.0 ……

WARNING: 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/venv

WARNING: You are using pip version 21.2.3; however, version 21.3.1 is available.

You should consider upgrading via the '/Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10 -m pip install --upgrade pip' command.

Run XX-Net in background.

i007@MP XX-Net % cd /Library/Frameworks/Python.framework/Versions/3.10/bin

i007@MP bin % python3.10 -m pip install --upgrade pip

Requirement already satisfied: pip in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (21.2.3)

Collecting pip

Downloading pip-21.3.1-py3-none-any.whl (1.7 MB)

|████████████████████████████████| 1.7 MB 68 kB/s

Installing collected packages: pip

Attempting uninstall: pip

Found existing installation: pip 21.2.3

Uninstalling pip-21.2.3:

Successfully uninstalled pip-21.2.3

Successfully installed pip-21.3.1

i007@MP bin % cd ~

i007@MP ~ % sudo chown -R i007 /Users/i007/Library/Caches/pip

Password:

i007@MP ~ % cd /Applications/XX-Net

i007@MP XX-Net % ./start

XX-Net version:4.5.4

Run XX-Net in background.

imagem007 commented 2 years ago

直接运行start结果(xx-net没有正常启动) i007@MP ~ % /Applications/XX-Net/start ; exit;

XX-Net version:4.5.4

Run XX-Net in background.

Saving session...

...copying shared history...

...saving history...truncating history files...

...completed.

[进程已完成]

imagem007 commented 2 years ago

现在,卸载xcode后重启也无法启动xx-net了。 运行结果一直是这样

i007@MP ~ % /Applications/XX-Net/start ; exit; XX-Net version:4.5.4 Run XX-Net in background.

Saving session... ...copying shared history... ...saving history...truncating history files... ...completed.

imagem007 commented 2 years ago

卸载了xcode,还是出错,看了一下error.log,里面提到了新安装的python3.10,可能是没配置好。卸载了python3.10,现在xx-net可以正常启动了。

Nov 01 16:14:48.451 type:<class 'EOFError'> value=EOF when reading a line traceback:Traceback (most recent call last): File "/Applications/XX-Net/code/default/launcher/start.py", line 193, in main() File "/Applications/XX-Net/code/default/launcher/start.py", line 171, in main module_init.start_all_auto() File "/Applications/XX-Net/code/default/launcher/module_init.py", line 121, in start_all_auto start(module) File "/Applications/XX-Net/code/default/launcher/module_init.py", line 44, in start proc_handler[module]["imp"] = import(module, globals(), locals(), ['local'], 0) File "/Applications/XX-Net/code/default/x_tunnel/local/init.py", line 5, in from . import web_control File "/Applications/XX-Net/code/default/x_tunnel/local/web_control.py", line 17, in from . import proxy_session File "/Applications/XX-Net/code/default/x_tunnel/local/proxy_session.py", line 13, in from gae_proxy.local import check_local_network File "/Applications/XX-Net/code/default/gae_proxy/local/init.py", line 2, in from . import apis File "/Applications/XX-Net/code/default/gae_proxy/local/apis.py", line 2, in from .front import front, direct_front File "/Applications/XX-Net/code/default/gae_proxy/local/front.py", line 12, in from front_base.connect_creator import ConnectCreator File "/Applications/XX-Net/code/default/lib/noarch/front_base/connect_creator.py", line 6, in import socks File "/Applications/XX-Net/code/default/lib/noarch/socks.py", line 63, in from collections import Callable ImportError: cannot import name 'Callable' from 'collections' (/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/collections/init.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Applications/XX-Net/code/default/launcher/start.py", line 200, in input("Press Enter to continue...") EOFError: EOF when reading a line

imagem007 commented 2 years ago

怎样能够在安装xcode和升级新版python后,能够正常启动xx-net,还是没整明白。

YLinXin commented 2 years ago

怎样能够在安装xcode和升级新版python后,能够正常启动xx-net,还是没整明白。

3.10有三方库的兼容问题。你自己得改好几个地方的引用。请使用-f参数foreground去调试。这样他会一步一步引导你直至正常运行。

bash ./start --help
XX-Net version:4.5.3

USAGE:

start -h
  show help.

start
 -allow_remote
   enable remote connect.

 -no_mess_system
   Don't mess the system, include not install CA to browser, not add shortcut to desktop automatically.

 -f
   Run in foreground, in Mac will run in background as default.

 -hungup
   start with nohup to run in background.

start set_iptables [interface]
  set iptables for transparent proxy.
  interface   The network interface which will be redirected
              Default is br-lan

start unset_iptables [interface]

root 13289 0.2 0.2 409613152 39488 ?? S Thu02PM 41:59.21 /opt/local/Library/Frameworks/Python.framework/Versions/3.10/Resources/Python.app/Contents/MacOS/Python code/4.5.3/launcher/start.py

YLinXin commented 2 years ago

找了下history

cat .code/4.5.3/lib/noarch/hyper/packages/hyperframe/flags.py

基本上都是把collections.MutableSet改成collections.abc.MutableSet

3.10的层级改了。一个一个的去改吧。

xxnet commented 2 years ago

谢谢 @YLinXin 已经发布新版修复该问题。

13611