Closed cjbeers closed 2 years ago
Hi @cjbeers, I'm taking a look at this now, and I'd be happy to help.
I unfortunately can't replicate the error on my machine - what version of Python and pip are you using?
Based on the output where the cause seems to be a missing file, it is possible there are some dependencies that need installing that I was not aware of when writing the docs.
If you haven't done so already, try installing the C++ build tools from Microsoft from here: https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022
Python version 3.9.7 and pip version 21.2.4.
I've installed the build tools for C++ previously but will check them and retry it.
Edit: I've installed the current C++ build tools and reran the cmd line but get the same errors.
I see references to anaconda in the output - I wonder if that is involved? I may try to install anaconda on one of my machines and see if I can replicate the problem.
This line:
subprocess.CalledProcessError: Command '['cargo', 'metadata', '--manifest-path', 'Cargo.toml', '--format-version', '1']' returned non-zero exit status 101.
Makes me think it could be a problem with cargo
not being found by the installer. If I remember correctly, installing cargo with rustup should modify the PATH appropriately, but maybe not - if you run cargo --version
on the command line does it show the version number?
I am using Anaconda and the Anaconda Prompt for my terminal.
My cargo version number is 1.54.0 which was installed with rustup. I do NOT have an environmental variable to cargo specifically, i.e.: https://doc.rust-lang.org/cargo/reference/environment-variables.html. I do have a reference to the .cargo/bin folder in my rustc user variable and system variable.
Maybe you can try installing rustc/cargo via conda?
I found this page: https://anaconda.org/conda-forge/rust
I wonder if running the conda install -c conda-forge/label/rust_dev rust
command would fix it - if that doesn't work, I'll proceed with installing anaconda locally and try working through it that way. I know very little about how anaconda works so I'm flying a little blind here.
I installed rust via conda but the error persists. Anaconda lists the packages which can be installed and gives indication if there are updates available for those packages. I still use pip install for installing new packages but this is done through the Anaconda Prompt.
Gotcha. Ok, I have installed anaconda on one of my Windows machines and unfortunately, am still unable to replicate the error - from the Anaconda prompt, making sure I'm using anaconda's python, pip install works fine with no errors. My best guess is there is a dependency already installed on my machine that is missing on yours - the trick will be figuring out what it is.
My next attempt will be to try to install it on a Windows machine that I have never used for development before - I'll keep you posted on any progress I make. Until then, the only other option I am aware of is to use Windows Subsystem for Linux, but that is not ideal.
I deleted all files, programs, and relevant environmental variables and started doing a fresh install following the flow that I did in the pasted word file. This doesn't produce the previous error but it still doesn't seem like it creates the python binding as it gives no module. I'm wondering if I'm missing an environmental variable setting.
Ah ok; I think the documentation is a little confusing. Thanks for writing out your process - it was very helpful. The from scripts.rustbca import *
line is for importing the various functions from the python file located in /scripts/rustbca.py
- it's a relative import from the rustbca directory.
The Python bindings can be imported using:
from libRustBCA.pybca import *
The former has scripts that simply call rustbca.exe using os.system calls (which probably won't work on Windows unless GnuWin32 is installed - that's something I should work on), while the latter actually uses the RustBCA Python bindings built by cargo (e.g., simple_bca_py(...)
).
Either way of running the code should work. The Python bindings are probably easier to use, but they might be a little slower than the standalone rustbca.exe per ion - and the standalone code has a lot more options that can be changed in the input file. I'll open another issue regarding making the documentation more clear in distinguishing the two ways of using Python to run the code.
Edit: Issue #175 has been created to track the aforementioned changes
Ok, I should be good then as I'm able to run and plot the He implantation into a layered TiO2/Al/Si target example. I'll close the question. Thanks for the help!
Glad to hear it - you're welcome!
To whom this concerns,
I'm hoping you can help me in getting RustBCA installed on windows? The installation goes smoothly until executing the "python -m pip install ." command to bind python and have the scripts.rustbca module created. I'm able to run the test cases that do not make use of the module.
Here is the error that I'm having: https://pastebin.com/Et7EwxfE What I'm seeing is, " ERROR: Failed building wheel for RustBCA Failed to build RustBCA ERROR: Could not build wheels for RustBCA which use PEP 517 and cannot be installed directly".