running pip to install python packages from inside powershell on vista - windows

im trying to follow this pretty good guide
http://www.tylerbutler.com/2012/05/28/how-to-install-python-pip-and-virtualenv-on-windows-with-powershell/
but im getting the following error when trying to install virtualenv
PS C:\> pip install virtualenv
The term 'pip' 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 include
d, verify that the path is correct and try again.
At line:1 char:4
+ pip <<<< install virtualenv
+ CategoryInfo : ObjectNotFound: (pip:String) [], CommandNotFound
Exception
+ FullyQualifiedErrorId : CommandNotFoundException
im a mac user normally, so i understand how to use pip, not sure why this isn't working though. not very good with powershell.

ok, emailed the author of the article and he pointed out that c:\Python27\Scripts needs to be on the path / PS $env:Path for pip to be picked up.
Once thats sorted, it'll install fine.

Related

The term 'submit50' is not recognized as the name of a cmdlet, function, script file, or operable program

I'm using VScode in windows 11, with the integrated powershell terminal.
After running pip3 install submit50 (and also pip3 install --upgrade submit50 just in case).
When running submit50 ai50/projects/2020/x/tictactoe I get the following error:
submit50 : The term 'submit50' 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.
+ submit50 ai50/projects/2020/x/tictactoe
+ ~~~~~~~~
+ CategoryInfo : ObjectNotFound: (submit50:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
other python and pip commands are running fine on my machine.
What did I do wrong here?
Python: Python 3.10.1 (tags/v3.10.1:2cd268a, Dec 6 2021, 19:10:37) [MSC v.1929 64 bit (AMD64)] on win32
Pip: pip 22.0.3 from C:\Python310\lib\site-packages\pip (python 3.10)

installing eth-brownie with pipx

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.

I see pip in the python/python39/scripts folder but it still says "pip command not found"

I tried pip3, it still doesn't do anything. I tried to reinstall it from reinstalling python or installing it in idle, but if i try to do "python get-pip.py" it just goes to another line, it doesnt do anything. im on windows btw
Edit: I followed what the commenter said, and if i type "py -m pip install" it lets me install a package so tysm
Try adding pip to environment variables . Original answer
On Windows pip3 should be in the Scripts path of your Python installation:
C:\path\to\python\Scripts\pip3
Use:
where python
to find out where your Python executable(s) is/are located. The result should look like this:
C:\path\to\python\python.exe
or:
C:\path\to\python\python3.exe
You can check if pip3 works with this absolute path:
C:\path\to\python\Scripts\pip3
if yes, add C:\path\to\python\Scripts to your environmental variable PATH

Mocha not recognized after windows 10 update

I'm no longer able to run mocha after installing the recent Windows 10 update. Rolling the update back is not an option. This is the error I'm getting:
mocha : The term 'mocha' 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
+ mocha .\mascusToCdhTransformationServiceTest.js
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (mocha:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I tried reinstalling my npm application. I noticed that it didn't recognize my python installation. I fixed that by running
npm install --global --production windows-build-tools
I've also tried several variations of
npm install mocha
npm install mocha -g
npm uninstall
npm install
All seemingly succeed but I still get the error that Windows doesn't recognize mocha. Is there something I can do to get Windows to run mocha again?
I had to add ~\AppData\Roaming\npm to my environment path variable. I'm not sure why it was removed, but adding it back resolved the issue.

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

Resources