m1芯片的macbook使用问题总结

1.protobuf 语言编译问题

m1芯片的macbook使用问题总结

protobuf 语言编译的时候会报错,控制台打印错误日志如下

[ERROR] Failed to execute goal org.xolstice.maven.plugins:protobuf-maven-plugin:0.6.1:compile (default-cli) on project grpc: Unable to resolve artifact: Missing:
[ERROR] ----------
[ERROR] 1) com.google.protobuf:protoc:exe:osx-aarch_64:3.12.0
[ERROR] 
[ERROR]   Try downloading the file manually from the project website.
[ERROR] 
[ERROR]   Then, install it using the command: 
[ERROR]       mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.12.0 -Dclassifier=osx-aarch_64 -Dpackaging=exe -Dfile=/path/to/file
[ERROR] 
[ERROR]   Alternatively, if you host your own repository you can deploy the file there: 
[ERROR]       mvn deploy:deploy-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.12.0 -Dclassifier=osx-aarch_64 -Dpackaging=exe -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR] 
[ERROR]   Path to dependency: 
[ERROR]   	1) com.reinmind:grpc:jar:1.0-SNAPSHOT
[ERROR]   	2) com.google.protobuf:protoc:exe:osx-aarch_64:3.12.0
[ERROR] 
[ERROR] ----------
[ERROR] 1 required artifact is missing.

原因是找不到com.google.protobuf:protoc:exe:osx-aarch_64:3.12.0这个包,protobuf还没开发

m1芯片的macbook使用问题总结

修改依赖指定使用x86_64的包才可以。

问题参见解决办法https://github.com/grpc/grpc-java/issues/7690

2.Rasa聊天机器人框架安装问题

Using cached matplotlib-3.4.0.tar.gz (37.1 MB)
    ERROR: Command errored out with exit status 1:
     command: /Users/songkai/PycharmProjects/venv/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/bl/jvw12kwj3d16_1gt9gkj9spw0000gn/T/pip-install-2ddy8q39/matplotlib_6ab53866c5844cf18e2455963afb5600/setup.py'"'"'; __file__='"'"'/private/var/folders/bl/jvw12kwj3d16_1gt9gkj9spw0000gn/T/pip-install-2ddy8q39/matplotlib_6ab53866c5844cf18e2455963afb5600/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/bl/jvw12kwj3d16_1gt9gkj9spw0000gn/T/pip-pip-egg-info-ufpwmx_a
         cwd: /private/var/folders/bl/jvw12kwj3d16_1gt9gkj9spw0000gn/T/pip-install-2ddy8q39/matplotlib_6ab53866c5844cf18e2455963afb5600/
    Complete output (108 lines):
    Processing numpy/random/_bounded_integers.pxd.in
    Processing numpy/random/_philox.pyx
    Traceback (most recent call last):
      File "/var/folders/bl/jvw12kwj3d16_1gt9gkj9spw0000gn/T/easy_install-c3kuq3_f/numpy-1.20.2/tools/cythonize.py", line 59, in process_pyx
        from Cython.Compiler.Version import version as cython_version
    ModuleNotFoundError: No module named 'Cython'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/var/folders/bl/jvw12kwj3d16_1gt9gkj9spw0000gn/T/easy_install-c3kuq3_f/numpy-1.20.2/tools/cythonize.py", line 235, in <module>
        main()
      File "/var/folders/bl/jvw12kwj3d16_1gt9gkj9spw0000gn/T/easy_install-c3kuq3_f/numpy-1.20.2/tools/cythonize.py", line 231, in main
        find_process_files(root_dir)
      File "/var/folders/bl/jvw12kwj3d16_1gt9gkj9spw0000gn/T/easy_install-c3kuq3_f/numpy-1.20.2/tools/cythonize.py", line 222, in find_process_files
        process(root_dir, fromfile, tofile, function, hash_db)
      File "/var/folders/bl/jvw12kwj3d16_1gt9gkj9spw0000gn/T/easy_install-c3kuq3_f/numpy-1.20.2/tools/cythonize.py", line 188, in process
        processor_function(fromfile, tofile)
      File "/var/folders/bl/jvw12kwj3d16_1gt9gkj9spw0000gn/T/easy_install-c3kuq3_f/numpy-1.20.2/tools/cythonize.py", line 64, in process_pyx
        raise OSError('Cython needs to be installed in Python as a module')
    OSError: Cython needs to be installed in Python as a module
    Running from numpy source directory.
    /var/folders/bl/jvw12kwj3d16_1gt9gkj9spw0000gn/T/easy_install-c3kuq3_f/numpy-1.20.2/setup.py:485: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
      run_build = parse_setuppy_commands()
    Traceback (most recent call last):
      File "/Users/songkai/PycharmProjects/venv/lib/python3.8/site-packages/setuptools/sandbox.py", line 154, in save_modules
        yield saved
      File "/Users/songkai/PycharmProjects/venv/lib/python3.8/site-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/Users/songkai/PycharmProjects/venv/lib/python3.8/site-packages/setuptools/sandbox.py", line 250, in run_setup
        _execfile(setup_script, ns)
      File "/Users/songkai/PycharmProjects/venv/lib/python3.8/site-packages/setuptools/sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
      File "/var/folders/bl/jvw12kwj3d16_1gt9gkj9spw0000gn/T/easy_install-c3kuq3_f/numpy-1.20.2/setup.py", line 513, in <module>
      File "/var/folders/bl/jvw12kwj3d16_1gt9gkj9spw0000gn/T/easy_install-c3kuq3_f/numpy-1.20.2/setup.py", line 493, in setup_package
      File "/var/folders/bl/jvw12kwj3d16_1gt9gkj9spw0000gn/T/easy_install-c3kuq3_f/numpy-1.20.2/setup.py", line 290, in generate_cython

    RuntimeError: Running cythonize failed!

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/bl/jvw12kwj3d16_1gt9gkj9spw0000gn/T/pip-install-2ddy8q39/matplotlib_6ab53866c5844cf18e2455963afb5600/setup.py", line 258, in <module>
        setup(  # Finally, pass this all along to distutils to do the heavy lifting.
      File "/Users/songkai/PycharmProjects/venv/lib/python3.8/site-packages/setuptools/__init__.py", line 144, in setup
        _install_setup_requires(attrs)
      File "/Users/songkai/PycharmProjects/venv/lib/python3.8/site-packages/setuptools/__init__.py", line 139, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "/Users/songkai/PycharmProjects/venv/lib/python3.8/site-packages/setuptools/dist.py", line 716, in fetch_build_eggs
        resolved_dists = pkg_resources.working_set.resolve(
      File "/Users/songkai/PycharmProjects/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 780, in resolve
        dist = best[req.key] = env.best_match(
      File "/Users/songkai/PycharmProjects/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1065, in best_match
        return self.obtain(req, installer)
      File "/Users/songkai/PycharmProjects/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1077, in obtain
        return installer(requirement)
      File "/Users/songkai/PycharmProjects/venv/lib/python3.8/site-packages/setuptools/dist.py", line 786, in fetch_build_egg
        return cmd.easy_install(req)
      File "/Users/songkai/PycharmProjects/venv/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 679, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "/Users/songkai/PycharmProjects/venv/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 705, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/Users/songkai/PycharmProjects/venv/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 890, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "/Users/songkai/PycharmProjects/venv/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 1158, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "/Users/songkai/PycharmProjects/venv/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 1144, in run_setup
        run_setup(setup_script, args)
      File "/Users/songkai/PycharmProjects/venv/lib/python3.8/site-packages/setuptools/sandbox.py", line 253, in run_setup
        raise
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/contextlib.py", line 131, in __exit__
        self.gen.throw(type, value, traceback)
      File "/Users/songkai/PycharmProjects/venv/lib/python3.8/site-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/contextlib.py", line 131, in __exit__
        self.gen.throw(type, value, traceback)
      File "/Users/songkai/PycharmProjects/venv/lib/python3.8/site-packages/setuptools/sandbox.py", line 166, in save_modules
        saved_exc.resume()
      File "/Users/songkai/PycharmProjects/venv/lib/python3.8/site-packages/setuptools/sandbox.py", line 141, in resume
        six.reraise(type, exc, self._tb)
      File "/Users/songkai/PycharmProjects/venv/lib/python3.8/site-packages/setuptools/_vendor/six.py", line 685, in reraise
        raise value.with_traceback(tb)
      File "/Users/songkai/PycharmProjects/venv/lib/python3.8/site-packages/setuptools/sandbox.py", line 154, in save_modules
        yield saved
      File "/Users/songkai/PycharmProjects/venv/lib/python3.8/site-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/Users/songkai/PycharmProjects/venv/lib/python3.8/site-packages/setuptools/sandbox.py", line 250, in run_setup
        _execfile(setup_script, ns)
      File "/Users/songkai/PycharmProjects/venv/lib/python3.8/site-packages/setuptools/sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
      File "/var/folders/bl/jvw12kwj3d16_1gt9gkj9spw0000gn/T/easy_install-c3kuq3_f/numpy-1.20.2/setup.py", line 513, in <module>
      File "/var/folders/bl/jvw12kwj3d16_1gt9gkj9spw0000gn/T/easy_install-c3kuq3_f/numpy-1.20.2/setup.py", line 493, in setup_package
      File "/var/folders/bl/jvw12kwj3d16_1gt9gkj9spw0000gn/T/easy_install-c3kuq3_f/numpy-1.20.2/setup.py", line 290, in generate_cython

    RuntimeError: Running cythonize failed!

    Edit setup.cfg to change the build options; suppress output with --quiet.

    BUILDING MATPLOTLIB
      matplotlib: yes [3.4.0]
          python: yes [3.8.2 (default, Dec 21 2020, 15:06:03)  [Clang 12.0.0
                      (clang-1200.0.32.29)]]
        platform: yes [darwin]
           tests: no  [skipping due to configuration]
          macosx: yes [installing]

    Cythonizing source

安装matplotlib-3.3.3.tar.gz 包报错

并且不支持RASA/Tensorflow operations for the new Apple M1 chips. We can try setting up a virtual machine, but it’s far less convenient than being able to run simple operations locally.

等待后续版本支持

参见问题解决链接 https://forum.rasa.com/t/apple-m1-illegal-hardware-instruction-using-any-rasa-command/37946/14

https://github.com/tensorflow/tensorflow/issues/46178#issuecomment-755428372

上一篇:极客日报第83期:百度92年程序员因“篡改数据”被抓;运营商辟谣首批 5G 用户被抛弃;特斯拉回应上海工厂摄像头被入侵


下一篇:M1 MacBook安装redis