installing eth-brownie with pipx - pip

I have been attempting to install Brownie via pipx in a Powershell terminal in VSCode (https://eth-brownie.readthedocs.io/en/stable/install.html). As in the link I attempted the first two commands after which the system gave me confirmation that pipx had been added to PATH:
python -m pip install --user pipx
python -m pipx ensurepath
...
C:\Users\Name\AppData\Roaming\Python\Python310\Scripts has been been added to PATH, but you need to open a new terminal or re-login for this PATH change to
take effect.
C:\Users\Name\.local\bin has been been added to PATH, but you need to open a new terminal or re-login for this PATH change to take effect.
You will need to open a new terminal or re-login for the PATH changes to take effect.
Otherwise pipx is ready to go! ✨ 🌟 ✨
Upon loading a new Powershell, I tried the final command as in the link, but instead got the error immediately below:
pipx install eth-brownie
...
pipx : The term 'pipx' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At line:1 char:1
+ pipx install eth-brownie
+ ~~~~
+ CategoryInfo : ObjectNotFound: (pipx:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Why is pipx not being recognized as a command if the output claimed it is accessible on PATH? In any case, I then tried modifying the command to include python -m at the start. My understanding is that this goes to my python program first, then accesses anything to do with pipx? It ran for a few seconds before printing a different error:
python -m pipx install eth-brownie
...
Fatal error from pip prevented installation. Full pip output in file:
C:\Users\Name\.local\pipx\logs\cmd_2022-01-05_20.58.07_pip_errors.log
pip failed to build package:
cytoolz
Some possibly relevant errors from pip install:
build\lib.win-amd64-3.10\cytoolz\functoolz.cp310-win_amd64.pyd : fatal error LNK1120: 1 unresolved externals
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\link.exe' failed with exit code 1120
Error installing eth-brownie.
I am at a loss on this error. My instinct tells me there is something wrong with my Microsoft Build Tools that I downloaded from: https://visualstudio.microsoft.com/visual-cpp-build-tools/Code . But if I can resolve the first issue perhaps this is redundant.

Make sure you have installed "pipx" from python3
if it is not installed, run
python3 -m pip install --user pipx
Or check env see if it is installed path
I also had the same error before, I tried with another environment from python
py -m pip install --user -U pipx
Best way to test pipx, checkin to directory :
C:\Users\...\.local
Add env
enter image description here
You will need to open a new terminal or re-login for the PATH changes to take effect.
Otherwise pipx is ready to go

I restarted my machine and was able to recognize pipx at least, but upon using "pipx install eth-brownie" I got the same fatal error as at the bottom of my post. I then verified I had cython and cytoolz installed (tried pip install for each and received output stating that the requirement was already satisfied) even though the error stated "pip failed to build package: cytoolz" In the end I found some posts suggesting that pipx only works for Python 3.9. I finally tried a pip install of eth-brownie rather than pipx and that worked.
If anyone knows of any potential pitfalls of a pip rather than pipx installation of eth-brownie I would be glad to hear, but at least it was installed in the end.

Related

How can I solve this installation problem with fastavro on Mac?

I am trying to run in my Mac a Python program which requires working with .avro binary files.
Despite trying to install it by using: pip install fastavro, I always get an error message on the terminal that ends with the following lines:
...
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for fastavro
Failed to build fastavro
ERROR: Could not build wheels for fastavro, which is required to install pyproject.toml-based projects
I have updated conda to its latest version on my PC as well as updated pip as well.
Does anyone know how to solve this? I really need to run this program on Mac as soon as possible. For your information, I am able to install and use fastavro on Windows but not on Mac so this is likely to be a Mac-specific problem.
Thanks a lot
Since you are working in a conda environment, why not install it with conda? I often find installations via conda much more convenient since it takes care of all non-Python dependencies as well.
So try uninstalling the package first with pip: pip uninstall fastavro and then installing it via conda: conda install fastavro -c conda-forge.
In case you are unfamiliar with the -c conda-forge flag, it tells conda to look for the package on the conda-forge channel which has almost all packages that are not available via the standard channels.

Devstack installation failed with error message "ERROR: Editable requirements are not allowed as constraints"

I encounter the following error when I run the script stack.sh:
Using python 3.6 to install setuptools!=24.0.0,!=34.0.0,!=34.0.1,!=34.0.2,!=34.0.3,!=34.1.0,!=34.1.1,!=34.2.0,!=34.3.0,!=34.3.1,!=34.3.2,!=36.2.0,!=48.0.0,!=49.0.0
+ inc/python:pip_install:187 : sudo -H LC_ALL=en_US.UTF-8 http_proxy= https_proxy= no_proxy= PIP_FIND_LINKS= SETUPTOOLS_SYS_PATH_TECHNIQUE=rewrite python3.6 -m pip install -c /opt/stack/requirements/upper-constraints.txt --ignore-installed 'setuptools!=24.0.0,!=34.0.0,!=34.0.1,!=34.0.2,!=34.0.3,!=34.1.0,!=34.1.1,!=34.2.0,!=34.3.0,!=34.3.1,!=34.3.2,!=36.2.0,!=48.0.0,!=49.0.0'
DEPRECATION: Constraints are only allowed to take the form of a package name and a version specifier. Other forms were originally permitted as an accident of the implementation, but were undocumented. The new implementation of the resolver no longer supports these forms. A possible replacement is replacing the constraint with a requirement.. You can find discussion regarding this at https://github.com/pypa/pip/issues/8210.
ERROR: Editable requirements are not allowed as constraints
++./stack.sh:main:752 err_trap
++./stack.sh:err_trap:530 local r=1
stack.sh failed: full log in /opt/stack/logs/stack.sh.log.2021-05-10-115040
Error on exit
And a little higher I have this warning:
Attempting uninstall: pip
Found existing installation: pip 21.1.1
Uninstalling pip-21.1.1:
Successfully uninstalled pip-21.1.1
Successfully installed pip-21.1.1
WARNING: Running pip as root will break packages and permissions. You
should install packages reliably by using venv:
https://pip.pypa.io/warnings/venv
Any idea why?
Thanks

Anaconda: ModuleNotFoundError: No module named 'conda'

Please note this error is different than what shows up (and has answer) in stackoverflow. It is definitely not duplicated.
I have seen this error before and has been able to fix it by modifying the PATH to include conda's path like below:
export PATH=/opt/cloudera/parcels/Anaconda/bin:$PATH
echo $PATH
/opt/cloudera/parcels/Anaconda/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/git/bin:/home/rxie/bin
For unknown reason, the error pops up again here, and doesn't go away even after I started a new session.
The last command I executed was:
conda upgrade -c conda-forge imbalanced-learn
and the command completed successfully.
What's wrong with conda?
Here is the directory of Anaconda:
#ls -la /opt/cloudera/parcels/Anaconda/bin/conda
-rwxrwxr-x 1 root root 531 Feb 18 16:29 /opt/cloudera/parcels/Anaconda/bin/conda
Note I have been using root to install packages.
Any clue is appreciated.
Thank you very much.
UPDATE:
Thank you #merv, I read your answer to the other thread. Not exactly same symptom though, I indeed tried out the first step which is to sudo pip install conda, after that, expectedly conda still throw same error so there is no way to continue with step 2 in your answer of conda install --revision <n-1>
I solve this problem installing the version 4.6.14 of conda as suggested on this issue 9004 before perform further installs.
conda install conda=4.6.14
It looks like further versions of conda are introducing this error.
I encountered similar problem when I was trying to install opencv, I execute following command on windows powershell:
conda install -c conda-forge opencv
The powershell gave the following error
conda : The term 'conda' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
conda install -c conda-forge opencv
CategoryInfo : ObjectNotFound: (conda:String) [],
CommandNotFoundException
FullyQualifiedErrorId : CommandNotFoundException
So I entered the condabin directory using cd command:
cd C:\Users\username\anaconda3\condabin
and executed following command
.\conda install -c conda-forge opencv
opencv got installed
So U too can navigate to condabin directory and then use .\conda instead of conda
It worked for me I hope it helps you too

Environment error when installing with pip

I'm trying to install some python libraries with pip and I'm getting a repeated error when running it. For example, if I run pip install -U py2app the download appears to proceed as normally, but then an error is raised:
Could not install packages due to an EnviromentError
Which is followed by a series of [Errno 1] Operation not permitted errors (with directories listed after each error).
This error has appeared a number of times on several different libraries I've attempted to install, and it's extremely frustrating. I've tried to update the tools that people have recommended to update for various pip errors and none of them have made any difference.
Is there an easy fix to this problem?
Try to install using the option --user for example:
$ pip install --user py2app
Passing the --user option will install a package just for the current user, rather than for all users of the system.

Python 3.5.1 pip install 'ImportError'

While using pip install I am getting the following error:
Error while finding spec for 'pip__main__' <: No module named 'urllib.request'; 'urllib' is not a package>; 'pip' is a package and cannot be directly executed
Any advice on this one?
I thought maybe it was related to the requests module itself but I tried to download other modules and had the same problem.
I've just upgraded from Python 3.3 to v3.5.1 on Windows and hit the same error message. I understand it's not the same as your problem.
It seems that the instructions from the docs to use:
python -m pip install SomePackage
are wrong, at least for Windows because I get the error message quoted by the OP.
I forgot to add the Scripts directory to my path, the same as previous releases. When I add it the problem is fixed. My path now has (for a default install of Python 3.5):
PATH=<blah>;%USERPROFILE%\AppData\Local\Programs\Python\Python35;%USERPROFILE%\AppData\Local\Programs\Python\Python35\Scripts
The pip executable is located in Scripts, so pip commands can now be executed directly, the same as always:
pip install urllib

Resources