execute GitHub installation via bash on Colab - bash

I am trying to install from a GitHub repo with bash code (the pip installation doesn't work).
I'm trying the following code (s. here for reference):
https://github.com/vi3k6i5/GuidedLDA
cd GuidedLDA
sh build_dist.sh
python setup.py sdist
pip install -e .
which I adapted for Colab to
!https://github.com/vi3k6i5/GuidedLDA
!cd GuidedLDA
!sh build_dist.sh
!python setup.py sdist
!pip install -e .
However, already the first line throws an Error: /bin/bash: https://github.com/vi3k6i5/GuidedLDA: No such file or directory
I am very new to bash, so apologies for rookie mistakes! I tried also
!"https://github.com/vi3k6i5/GuidedLDA"
!github.com/vi3k6i5/GuidedLDA
!"github.com/vi3k6i5/GuidedLDA"
Then I tried using xdg-open with
!xdg-open https://github.com/vi3k6i5/GuidedLDA
and
!apt-get install xdg-open
!xdg-open https://github.com/vi3k6i5/GuidedLDA
all to no avail.
Can someone point me in the right direction?

Previously I used the git throw command.
it was difficult for me.
Now I use GitHub desktop.
it is too easy to handle everything.
you can check this playlist ->
https://www.youtube.com/playlist?list=PLcL8q_TiioW0JLk03hM3cu_Nb5DRwBHa1

Related

"pre-commit" command is not found by bash but is installed on macOS

Problem Description
I'm having trouble making commits, when I try to make a commit with the command, for example:
$ git commit -m "add readme"
pre-commit not found. Install pre-commit with the command pip3 install --user pre-commit or follow the steps on official documentation: https://pre-commit.com /#install
Following the steps described in the pre-commit installation documentation I installed by the command:
$ pip install pre-commit
However when I trigger the command the following error occurs:
$ pre-commit --version
bash: pre-commit: command not found
My attempt fails
I've tried some other solutions for this but they didn't work:
Export bash
I already tried this solution described that would be to export my ~./bashrc with the command: source ~/.profile but the following error happens:
bash:/Users/pvieira/.profile: No such file or directory
Install using homebrew
Doing so the same error that occurs when installing by pip appears here.
I was able to solve the problem by simply restarting the terminal.
I solved this problem by restarting my ubuntu system

can't use pip when I activate venv

Most of you may know OpenAI playground, so I built an function generator app and followed all the instructions but I can't launch it via venv-python. I can actually install the requirements using pip while venv is not active and can launch the site with flask, but when I try to install requirements after activating venv, I get this error;
User#lalec ~
$ cd openai-quickstart-python
User#lalec ~/openai-quickstart-python (master)
$ . venv/Scripts/activate
(venv)
User#lalec ~/openai-quickstart-python (master)
$ pip install -r requirements.txt
Fatal error in launcher: Unable to create process using '"C:\Users\celal\openai-quickstart-python\venv\Scripts\python.exe" "C:\Users\User\openai-quickstart-python\venv\Scripts\pip.exe" install -r requirements.txt': The system cannot find the file specified.
How do I fix this? I added every possible script locations into PATH I thought it would help but no result.
I just realized two directories in the error doesn't match, and "C:\Users\celal\openai-quickstart-python\venv\Scripts\python.exe" actually does not even exist. Maybe that's the problem... How can I change this ??
Sorry if I'm asking dumb questions I'm new to all this... Also, I don't get why I need venv activated while I can just launch it by accessing the directory and type flask run in cmd, would appreciate any answers.
ss of the project's directory
ss of venv/Scripts/
ss of bash screen with errors
The error message suggests that the requirements.txt file can't be read. Check that you definitely can read it and it's in the expected location.
The perferred command for running pip is:
python3 -m pip install -r requirements.txt
This makes sure that you know which python3 binary you're running pip with - some systems have more than one python3 binary in various locations.
You could achieve similar without activating the virtual environment:
./venv/bin/python3 -m pip install -r requirements.txt

Can't get pip working with psychopy install

I am very new to python and plan to use psychopy quite a lot. I am on a work computer but have full admin rights.
Psychopy came with python version 2.7.11 and includes setuptools already.
I am trying to install the selenium module, but having trouble getting pip to work at all.
In cmd, it is recognising the 'python' command, so I know python is in my path.
I get the message "can't open file 'pip': [Errno2] No such file or directory" from:
python pip install selenium
I get " 'pip' is not recognised as an internal or external command" from:
pip install selenium
When I change directory to where pip is located, I get:
Fatal error in launcher: Unable to create process using '"'
Using pip2 makes no difference.
It seems a simple thing but where am I going wrong with this?!
I never really got to the bottom of this, but this is what I found out and here are the commands that worked for me in Windows. Be aware that I am far from expert!
To run python scripts (*.py) from command line (cmd) then C:\PsychoPy2 and C:\PsychoPy2\DLLs need to be in path. ('Path' contains directories or file extensions that can be more globally accessed, i.e. do not require you to change the prompt to the relevant directories first).
To check, open cmd and either type echo %PATH% or just type python. (If python starts, the line will say >>>. You can exit by typing quit())
To add to path, get properties of computer, then advanced system settings, then environment variables.
To check pip.exe (a sort of installation wizard) is installed, either search for the file, or check C:\PsychoPy2\Scripts for it. This may also need to be in path.
To reinstall the latest versions of pip and setup tools, I went to cmd and typed:
python -m pip install -U pip setuptools
If the same code did not work for other modules (which in my case was due to network access), then I downloaded the wheel file (*.whl) for that module (from their website) and ran the following code:
python -m pip install c:/modulename.whl
These may not be the correct ways of doing things, but they worked for me when I couldn't get other ways to work!
I've just had the exact same issue with the pip install, and a conflict with PsychoPy installations. I think it's because python automatically wants to call on the path that's been set by Psychopy, so it can't get to the 'pip' folders that for me, remain in a temporary/hidden file. This wasn't intuitive for me - on any machine without psychopy python just 'works' when you download it.

unable to install python package/module on windows (tried easy install as well as pip already)

I use Ipython Notebook and at times need to install new python packages like plotly, scikit etc. I have already tried using the most popular methods PIP and Easy Install to install the packages directly from cmd in windows but neither works. Here is the error that I get-
C:\Users\xxxx>pip install plotly
Fatal error in launcher: Unable to create process using '"'
And with easy install, I get some error as well.
Is there a third way of installing packages?
May be manually installing the package after downloading the .tar.gz file?
I found the answer. In case when both pip and easy_install fails, there is a third way (as simple as pip and easy_install).
Step 1) Go to https://pypi.python.org/ to find the desired python module/package and download the *.tar.gz file (example name: plotly-1.9.6.tar.gz) and save it anywhere.
Step 2) Unzip the file to get plotly-1.9.6. Inside this folder you will find setup.py. Open cmd and browse till the root folder of setup.py and use this command -
python setup.py install
And you are good.
If you know of any fourth method, do share it here.

Sphinx-quickstart doesn't work

I am trying to install sphinx on a remote machine.
Since I don't have an access to the root, I did this:
$bash
$mkdir -p ~/local/lib/python2.7/site-packages
$export PYTHONPATH=$PYTHONPATH:~/local/lib/python2.7/site-packages
$export PATH=$PATH::~/local/lib/python2.7/site-packages
$easy_install -U --prefix=$HOME/local Sphinx
But apparently, $easy_install doesn't build sphinx-quickstart; when I type
$sphinx-quickstart
I get the following message:
bash: sphinx-quickstart: command not found
I tried
find $HOME -name sphinx-quickstart
and no result was found. However, I can import sphinx inside python:
$python
And then
>>import sphinx
works. Any idea why sphinx-quickstart doesn't work?
An alternative way to invoke sphinx-quickstart is to explicitly load Sphinx's quickstart module. For Sphinx v1.7+:
python -m sphinx.cmd.quickstart
For older versions of Sphinx:
python -m sphinx.quickstart
For example:
$ /c/Python35/python -m sphinx.quickstart
Welcome to the Sphinx 1.6.2 quickstart utility.
...
I found the solution in this webpage:
User (root/sudo free) installation of Python modules.
In section 3. Python 2.6+ he mentioned that the command line commands are in
~/local/bin
Although I had put ~/local/lib/python2.7/siste-packages in the path, the ~/local/bin directory was not in the path. So all I did
$export PYTHONPATH=$PYTHONPATH:~/local/bin
and now it works.
I don't know why find $HOME -name sphinx-quickstart did not find sphinx-quickstart
In MacOS (Catalina) and zsh:
I installed sphinx with brew and had the same problem as you.
Solution:
Installed it with conda as conda install sphinx and now it works for me
$ sphinx-quickstart
Welcome to the Sphinx 2.3.0 quickstart utility.
Installation Guide
Note, if you're in a virtual environment and using poetry to run
poetry run py -m sphinx.cmd.quickstart
where py is the python launcher for Windows.
Have added an answer for installation on macOS using brew here
For new users, installing with brew gives the following caveats:
==> sphinx-doc
sphinx-doc is keg-only, which means it was not symlinked into /usr/local,
because this formula is mainly used internally by other formulae.
Users are advised to use `pip` to install sphinx-doc.
If you need to have sphinx-doc first in your PATH, run:
echo 'export PATH="/usr/local/opt/sphinx-doc/bin:$PATH"' >> ~/.zshrc
Running the echo command:
echo 'export PATH="/usr/local/opt/sphinx-doc/bin:$PATH"' >> ~/.zshrc
should fix the issue.
Don't miss source-ing the .zshrc after the updating it:
source ~/.zshrc

Resources