conda says that my shell has not been configured even after it has been configured
dsw opened this issue · comments
conda says that by shell has not been configured:
f4pga-install$ xc7/conda/bin/conda activate xc7
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
but it has been configured:
$ grep 'conda initialize' ${HOME}/.bashrc
# >>> conda initialize >>>
# <<< conda initialize <<<
I'm running Ubuntu Linux in the default setup (bash).
@dsw can you please provide the steps you followed to create the environment? I've seen that happen in CI, but it's typically a transitory issue.
After installing conda, did you restart your shell?
@dsw, I could reproduce the issue in CI (https://github.com/antmicro/f4pga/actions/runs/2380264724), using ubuntu 18.04, 20.04 or 22.04. However, I did find the solution yet.
@dsw, see antmicro@0696ecf. CI run: https://github.com/antmicro/f4pga/actions/runs/2381259375.
According to https://f4pga-examples.readthedocs.io/en/latest/building-examples.html, you need to both export the path and source ...profile.d/conda.sh
.
@dsw, I acknowledge that the setup is non-standard. Without going into much detail, It's a mix of using Conda, having the FPGA_FAM envvar (because of differences between the xc7 and quicklogic families), and "manually" installing the arch-defs packages. All of that is being worked on:
- The differences in the layout of arch-defs packages for xc7 and quicklogic are being homogeneized.
- Last week, Python package
f4pga
was merged in this repo (https://github.com/chipsalliance/f4pga/tree/main/f4pga). That will eventually allow to get rid of the F4PGA_FAM and the INSTALL_DIR envvars, replacing them with CLI options (or a JSON configuration file). - Eventually, enough tools and patches will be upstreamed to the repos of most known distributions, and Conda won't be a requirement. Meanwhile, having the F4PGA Conda environment preinstalled in a container is kind of cheating, but does work:
@dsw, it's work in progress. See https://github.com/chipsalliance/f4pga-examples/pull/306/files and #562.
@dsw, actuallly, those code-blocks are treated as "executable snippets" by the CI. "tuttest" parses the sources of the docs, extracts code-blocks and executes them. See https://github.com/chipsalliance/f4pga-examples/blob/main/.github/scripts/install-toolchain.sh#L48 and https://raw.githubusercontent.com/chipsalliance/f4pga-examples/main/docs/getting.rst. Therefore, I don't know how would contributing the "standalone" scripts play with having them tested in CI. Maybe "including" them in rst does work, but I'm unsure.
Nevertheless, you might want to add an "admonition" to the documentation, to provide a "hint" to future readers. There, you might suggest them to save those lines in files and add them to .bashrc
. The sources are:
The syntax to add admonitions is the following:
.. HINT::
Your text goes here.
You can include code-blocks if you want:
.. code-block::
source myscript.sh