Giter VIP home page Giter VIP logo

pybin's Issues

PATH not being modified on macOS (High Sierra 10.13.5)

I'm trying to use hatch on macOS (High Sierra 10.13.5), and need to use pybin to update my patch to find the installed hatch script, but I can't get pybin to modify my path.

What am I doing wrong?

$ pip3 install --user hatch

$ hatch
-bash: hatch: command not found

$ sudo -H pip3 install pybin

$ pybin
The user bin directory `/Users/brendan/Library/Python/3.7/bin` is not in PATH.

$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

$ pybin put
Success!

$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

$ pybin put -f
Success!

$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Pybin should prefix added path line with a newline

I found that in a default skeleton user directory in Elementary 5 (based on Ubuntu bionic), there is no final newline in the .bashrc file, which instead finishes with the word 'esac' which is the end of a case statement.

Pybin's default editing behaviour therefore causes this error...

bash: /home/cefn/.bashrc: line 171: syntax error near unexpected token `PATH="/home/cefn/.local/bin:$PATH"'
bash: /home/cefn/.bashrc: line 171: `esacexport PATH="/home/cefn/.local/bin:$PATH"'

This is easily resolved by putting a newline after the word 'esac' but it would be better if pybin preceded the edit performed by its 'put' behaviour with a newline to be sure this doesn't happen.

Great work - suggestions for tutorial and console output

This is a great little utility and I hope it is able to be maintained.

As you have probably noticed at pypa/pip#3813 there was a big issue around the message which should be shown to the user, regardless of what changes might be made.

Unfortunately I think pybin retains some of these issues of documentation and understandability in terms of the guidance and messages shown, but I think they may be easily fixed with your help.

Fix 1: Change the github README instructions so that users run python3 -m pybin

I suffer from the Debian curse of no .local/bin in my $PATH . Of course, this means that it is impossible to run pybin which is in .local/bin, which defeats its own purpose. Running the 'package main' of pybin using the -m option works regardless if .local/bin is on the path or not.

Fix 2: Provide an instruction showing how to fix the issue

I ran the following...

python3 -m pybin 
The user bin directory `/home/cefn/.local/bin` is not in PATH.

...but I was disappointed that it didn't offer a fix. It should instead read as follows.

python3 -m pybin 
The user bin directory `/home/cefn/.local/bin` is not in PATH.
Run type the following line and press enter to fix your path...
python3 -m pybin put

Alternatively you could have pybin by default offer an interactive prompt to fix a non-existent path, with flags to override interactive (do nothing) or force (change the path non-interactively).

Success!

I ran...

python3 -m pybin put
Success!

..and it had successfully added the path line to the end of my .bashrc. Brilliant! This will be very useful for me as an educator working with learners who may be following my instructions to install python3 at home, as part of the VGKits Vanguard project.

Thanks for your intervention. It could save a world of pain for lots of people.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.