question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cargo dependency for anchor.py

See original GitHub issue

During a docker container build with anchor.py==0.8.0 in requirements.txt we are encountering the following error -

ERROR: Could not find a version that satisfies the requirement pyheck== (from versions: 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.1.5)
ERROR: No matching distribution found for pyheck==
bash-5.1# pip install --use-deprecated=legacy-resolver pyheck==0.1.5
Collecting pyheck==0.1.5
  Downloading pyheck-0.1.5.tar.gz (3.4 kB)
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /usr/lib/python3.9/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-8jbs9l9k/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'maturin>=0.12,<0.13'
       cwd: None
  Complete output (57 lines):
  Collecting maturin<0.13,>=0.12
    Downloading maturin-0.12.11.tar.gz (141 kB)
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'done'
      Preparing wheel metadata: started
      Preparing wheel metadata: finished with status 'done'
  Collecting tomli>=1.1.0
    Using cached tomli-2.0.1-py3-none-any.whl (12 kB)
  Building wheels for collected packages: maturin
    Building wheel for maturin (PEP 517): started
    Building wheel for maturin (PEP 517): finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 /usr/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmp5xajsdl4
         cwd: /tmp/pip-install-4hr6qk0z/maturin_3c608d77a7bc49019ad66524cd05095f
    Complete output (36 lines):
    running bdist_wheel
    running build
    installing to build/bdist.linux-x86_64/wheel
    running install
    Traceback (most recent call last):
      File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
        main()
      File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
      File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 204, in build_wheel
        return _build_backend().build_wheel(wheel_directory, config_settings,
      File "/tmp/pip-build-env-c2ng6n20/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 216, in build_wheel
        return self._build_with_temp_dir(['bdist_wheel'], '.whl',
      File "/tmp/pip-build-env-c2ng6n20/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 202, in _build_with_temp_dir
        self.run_setup()
      File "/tmp/pip-build-env-c2ng6n20/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 145, in run_setup
        exec(compile(code, __file__, 'exec'), locals())
      File "setup.py", line 118, in <module>
        setup(
      File "/tmp/pip-build-env-c2ng6n20/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
        return distutils.core.setup(**attrs)
      File "/usr/lib/python3.9/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib/python3.9/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/tmp/pip-build-env-c2ng6n20/overlay/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 335, in run
        self.run_command('install')
      File "/usr/lib/python3.9/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "setup.py", line 60, in run
        raise RuntimeError(
    RuntimeError: cargo not found in PATH. Please install rust (https://www.rust-lang.org/tools/install) and try again

Is there a known fix for this?

We have tried adding a rust dependency manually in a Docker build to work around it with little luck - things get stuck indefinitely in the following stage:

Collecting pyheck<0.2.0,>=0.1.4
  Using cached pyheck-0.1.5.tar.gz (3.4 kB)
  Installing build dependencies ... -

Any recommendations would be greatly appreciated!

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
kevinheaveycommented, Apr 4, 2022

python3 -m pip install --upgrade pip

I think this is actually the only part you need.

What you’re seeing is pip trying to build pyheck from source, which it shouldn’t be doing in this case.

Pyheck has prebuilt wheels on pypi for all the common platforms so you don’t need to have rust installed.

However I remember some older versions of pip not being able to find these wheels. So yeah just use an up-to-date pip

0reactions
kevinheaveycommented, May 26, 2022

@raymondjacobson did you figure out if something was wrong in the end? I’m going to be inflicting some Rust on solana-py and would like to know if there’s something missing for some platform

Read more comments on GitHub >

github_iconTop Results From Across the Web

unable to use anchor on arm · Issue #95 - GitHub
Description When trying to use anchor on a m1 based mac I get the below ... update the cargo dependencies to 1.7 and...
Read more >
anchor-lang - Rust Package Registry - Crates.io
anchor -lang v0.26.0 appears to have no README.md file ... Add the following line to your Cargo.toml file: anchor-lang = "0.26.0" ...
Read more >
Specifying Dependencies - The Cargo Book
To specify a dependency from a registry other than crates.io, first the registry must be configured in a .cargo/config.toml file. See the registries ......
Read more >
Cargo Error: failed to get `X` as a dependency - Stack Overflow
I am getting this weird error: cargo build Updating crates.io index error: failed to get ` ...
Read more >
Do Rust dependencies get nasty like JS or Python?
I remember many-a-hour lost to Python and Node because of weird dependency evil magic. But Rust? Rust is so nice. Cargo is my...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found