Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install MacOS 12.5 (M1 ARM64) #171

Open
denisbondar opened this issue Aug 8, 2022 · 12 comments
Open

Cannot install MacOS 12.5 (M1 ARM64) #171

denisbondar opened this issue Aug 8, 2022 · 12 comments
Labels

Comments

@denisbondar
Copy link

Couldn't find the answer on my own. I turn to the community for help. I am trying to install easysnmp on a MacOS 12.5 computer on an M1 Pro processor. I get the following output:

Collecting easysnmp
  Using cached easysnmp-0.2.6.tar.gz (43 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [17 lines of output]
      running egg_info
      creating /private/var/folders/1x/j7f60dtd3qlbg3vtd6r0zqlh0000gn/T/pip-pip-egg-info-h4qgsnzc/easysnmp.egg-info
      writing /private/var/folders/1x/j7f60dtd3qlbg3vtd6r0zqlh0000gn/T/pip-pip-egg-info-h4qgsnzc/easysnmp.egg-info/PKG-INFO
      writing dependency_links to /private/var/folders/1x/j7f60dtd3qlbg3vtd6r0zqlh0000gn/T/pip-pip-egg-info-h4qgsnzc/easysnmp.egg-info/dependency_links.txt
      writing top-level names to /private/var/folders/1x/j7f60dtd3qlbg3vtd6r0zqlh0000gn/T/pip-pip-egg-info-h4qgsnzc/easysnmp.egg-info/top_level.txt
      writing manifest file '/private/var/folders/1x/j7f60dtd3qlbg3vtd6r0zqlh0000gn/T/pip-pip-egg-info-h4qgsnzc/easysnmp.egg-info/SOURCES.txt'
      reading manifest file '/private/var/folders/1x/j7f60dtd3qlbg3vtd6r0zqlh0000gn/T/pip-pip-egg-info-h4qgsnzc/easysnmp.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'LICENSE'
      writing manifest file '/private/var/folders/1x/j7f60dtd3qlbg3vtd6r0zqlh0000gn/T/pip-pip-egg-info-h4qgsnzc/easysnmp.egg-info/SOURCES.txt'
      error: /Library/Developer/CommandLineTools/usr/bin/otool-classic: can't open file: build/lib.macosx-10.9-universal2-3.10/easysnmp/interface.cpython-310-darwin.so (No such file or directory)
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/1x/j7f60dtd3qlbg3vtd6r0zqlh0000gn/T/pip-install-7dn44ifk/easysnmp_5b26ccf0ff6949e59294246ee5fabbf1/setup.py", line 179, in <module>
          linked, target_lib, b.build_platlib, ext),
      NameError: name 'target_lib' is not defined. Did you mean: 'target_libs'?
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

net-snmp and gcc are installed.

@kamakazikamikaze
Copy link
Collaborator

Looks like you're experiencing an issue with library resolution due to how the old method of extracting info from brew was being performed.

Please try the following and report back on whether or not it installs correctly:

pip install https://github.com/easysnmp/easysnmp/archive/testing.zip

@denisbondar
Copy link
Author

If you mean the URL https://github.com/easysnmp/easysnmp/archive/refs/heads/test.zip here is the result:

Collecting https://github.com/easysnmp/easysnmp/archive/refs/heads/test.zip
  Using cached https://github.com/easysnmp/easysnmp/archive/refs/heads/test.zip
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [11 lines of output]
      Error: No such keg: /opt/homebrew/Cellar/net-snmp
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/1x/j7f60dtd3qlbg3vtd6r0zqlh0000gn/T/pip-req-build-76hjuwqn/setup.py", line 66, in <module>
          brew = check_output('brew list net-snmp', shell=True).decode()
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 420, in check_output
          return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 524, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command 'brew list net-snmp' returned non-zero exit status 1.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

I have net-snmp installed without using homebrew.

> brew list net-snmp
Error: No such keg: /opt/homebrew/Cellar/net-snmp

> pkgutil --file-info /usr/bin/snmpwalk                                
volume: /
path: /usr/bin/snmpwalk

> snmpbulkwalk --version
NET-SNMP version: 5.6.2.1

@kamakazikamikaze
Copy link
Collaborator

If you mean the URL https://github.com/easysnmp/easysnmp/archive/refs/heads/test.zip

That's correct; sorry for the bad URL.

  × python setup.py egg_info did not run successfully.

  │ exit code: 1

  ╰─> [11 lines of output]

      Error: No such keg: /opt/homebrew/Cellar/net-snmp

Brew is certainly installed. The keg Net-SNMP does not appear to be.

> snmpbulkwalk --version

NET-SNMP version: 5.6.2.1

Are you using the system-included Net-SNMP binaries/library? If so, we highly recommend using the Homebrew package instead as this will include some memory leak fixes and newer OpenSSL support. brew update && brew install net-snmp is all you'd need to run before trying to install EasySNMP again.

If you cannot install Net-SNMP via brew for some reason (security restrictions, explicit Net-SNMP library version required, etc), please let us know why.

@denisbondar
Copy link
Author

Result after installation using the homebrew:

Collecting https://github.com/easysnmp/easysnmp/archive/refs/heads/test.zip
  Using cached https://github.com/easysnmp/easysnmp/archive/refs/heads/test.zip
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [22 lines of output]
      running egg_info
      creating /private/var/folders/1x/j7f60dtd3qlbg3vtd6r0zqlh0000gn/T/pip-pip-egg-info-eiwu2fvq/easysnmp.egg-info
      writing /private/var/folders/1x/j7f60dtd3qlbg3vtd6r0zqlh0000gn/T/pip-pip-egg-info-eiwu2fvq/easysnmp.egg-info/PKG-INFO
      writing dependency_links to /private/var/folders/1x/j7f60dtd3qlbg3vtd6r0zqlh0000gn/T/pip-pip-egg-info-eiwu2fvq/easysnmp.egg-info/dependency_links.txt
      writing top-level names to /private/var/folders/1x/j7f60dtd3qlbg3vtd6r0zqlh0000gn/T/pip-pip-egg-info-eiwu2fvq/easysnmp.egg-info/top_level.txt
      writing manifest file '/private/var/folders/1x/j7f60dtd3qlbg3vtd6r0zqlh0000gn/T/pip-pip-egg-info-eiwu2fvq/easysnmp.egg-info/SOURCES.txt'
      reading manifest file '/private/var/folders/1x/j7f60dtd3qlbg3vtd6r0zqlh0000gn/T/pip-pip-egg-info-eiwu2fvq/easysnmp.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'LICENSE'
      writing manifest file '/private/var/folders/1x/j7f60dtd3qlbg3vtd6r0zqlh0000gn/T/pip-pip-egg-info-eiwu2fvq/easysnmp.egg-info/SOURCES.txt'
      error: /Library/Developer/CommandLineTools/usr/bin/otool-classic: can't open file: build/lib.macosx-10.9-universal2-3.10/easysnmp/interface.cpython-310-darwin.so (No such file or directory)
      Usage: /Library/Developer/CommandLineTools/usr/bin/install_name_tool [-change old new] ... [-rpath old new] ... [-add_rpath new] ... [-delete_rpath old] ... [-id name] input
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/1x/j7f60dtd3qlbg3vtd6r0zqlh0000gn/T/pip-req-build-wm8keu6u/setup.py", line 172, in <module>
          _ = check_output(
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 420, in check_output
          return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 524, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command 'install_name_tool -change  /opt/homebrew/Cellar/net-snmp/5.9.3/lib/libnetsnmp.dylib build/lib.macosx-10.9-universal2-3.10/easysnmp/interface.cpython-310-darwin.so' returned non-zero exit status 1.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

@denisbondar denisbondar changed the title [Question] Cannot install MacOS 12.5 (M1 ARM64) Cannot install MacOS 12.5 (M1 ARM64) Aug 11, 2022
@kamakazikamikaze
Copy link
Collaborator

What output do you get when you run brew list net-snmp?

@denisbondar
Copy link
Author

What output do you get when you run brew list net-snmp?

/opt/homebrew/Cellar/net-snmp/5.9.3/bin/agentxtrap
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/checkbandwidth
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/encode_keychange
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/fixproc
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/ipf-mod.pl
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/mib2c
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/mib2c-update
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/net-snmp-cert
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/net-snmp-config
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/net-snmp-create-v3-user
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/snmp-bridge-mib
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/snmpbulkget
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/snmpbulkwalk
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/snmpcheck
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/snmpconf
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/snmpdelta
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/snmpdf
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/snmpget
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/snmpgetnext
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/snmpinform
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/snmpnetstat
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/snmppcap
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/snmpping
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/snmpps
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/snmpset
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/snmpstatus
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/snmptable
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/snmptest
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/snmptop
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/snmptranslate
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/snmptrap
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/snmpusm
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/snmpvacm
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/snmpwalk
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/tkmib
/opt/homebrew/Cellar/net-snmp/5.9.3/bin/traptoemail
/opt/homebrew/Cellar/net-snmp/5.9.3/include/net-snmp/ (183 files)
/opt/homebrew/Cellar/net-snmp/5.9.3/lib/libnetsnmp.40.dylib
/opt/homebrew/Cellar/net-snmp/5.9.3/lib/libnetsnmpagent.40.dylib
/opt/homebrew/Cellar/net-snmp/5.9.3/lib/libnetsnmphelpers.40.dylib
/opt/homebrew/Cellar/net-snmp/5.9.3/lib/libnetsnmpmibs.40.dylib
/opt/homebrew/Cellar/net-snmp/5.9.3/lib/libnetsnmptrapd.40.dylib
/opt/homebrew/Cellar/net-snmp/5.9.3/lib/pkgconfig/ (2 files)
/opt/homebrew/Cellar/net-snmp/5.9.3/lib/ (10 other files)
/opt/homebrew/Cellar/net-snmp/5.9.3/sbin/snmpd
/opt/homebrew/Cellar/net-snmp/5.9.3/sbin/snmptrapd
/opt/homebrew/Cellar/net-snmp/5.9.3/share/man/ (134 files)
/opt/homebrew/Cellar/net-snmp/5.9.3/share/snmp/ (174 files)

@kamakazikamikaze
Copy link
Collaborator

Ah ok, I missed an important detail from your output after installing Net-SNMP via Brew.

error: /Library/Developer/CommandLineTools/usr/bin/otool-classic: can't open file: build/lib.macosx-10.9-universal2-3.10/easysnmp/interface.cpython-310-darwin.so (No such file or directory)

I'm able to replicate this on my 12.5 VM. I'll dive into it.

@kamakazikamikaze
Copy link
Collaborator

Looks like the issue is due to pip running the egg_info command and the setup.py script performing a library link regardless of what command is passed in. I'll probably need to look into extending the build_ext/build commands so that this step only occurs when the C extension is built. Hopefully I can have it patched by Monday.

@kamakazikamikaze
Copy link
Collaborator

kamakazikamikaze commented Aug 21, 2022

Ok, I've merged the necessary changes into the "test" branch. I've also added a patch that re-enables Net-SNMP 5.6.2.1 support on macOS. You can choose to use the Brew Net-SNMP or system-included Net-SNMP library. (If you need modern SSL cipher support, go with Brew).

@denisbondar
Copy link
Author

Now the installation (from test) runs correctly. Thank you very much!

@svlobanov
Copy link

Is it possible to merge the fix to the version provided via pip? test version is working fine, but if you install from pip on macos, it still fails

thanks for the library and mutli OS support

@denisbondar
Copy link
Author

Unfortunately, the project looks like it has been abandoned. I wonder if there are any alternatives (other than the abandoned PySNMP)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants