Installing Bugjar - the GUI debugger for Python - python

I have come across this issue multiple times
The instructions for installing and running bugjar are just the following:
$ pip install bugjar
$ bugjar myscript.py arg1 arg2
I never understood what that dollar sign stands for?
I am using Python(x,y) 2.7 and I managed to run the pip install bugjar in iPython shell (I don't know what a shell is, I usually run and write my code in Spyder; but that particular command would not run in Spyder).
And now I do not know how to initiate the GUI debugger. I tried to run bugjar test.py in that same shell, though it does not work. It appears that I have to pass two arguments. But the instructions do not say which arguments are meant to be passed.
How do I actually initiate the GUI?

$ is just a general way of indicating a command prompt in Linux / UNIX systems.
It would basically be your C:\> prompt in Windows. It's not something you type out to get your installation working.
If you're on Windows and have never installed a python package using pip before, open up a Windows console or command line terminal (You can click Start Menu, Run, then type "cmd" and press Enter to open a Windows console). Then follow these instructions first to install pip on your system:
https://pip.pypa.io/en/latest/installing.html
After pip is installed on your system, then you can run the commands in your Windows console as instructed by the Bugjar installation guide (minus the $ signs).

Related

Python IDLE won't run on Debian/Ubuntu Linux

I used: "sudo apt-get install idle3" and "sudo apt install idle" in my attempts to install Python IDLE from the terminal. Both worked fine, with a successful installation message afterwards. However, when I type $ idle or $ idle3, nothing happens. When I tried to open it from the "Applications" menu, it also would not open. (Note: I can set up a python file and run it without trouble, so I am sure that both Python2 and 3 are properly installed.) Any suggestions on how to make IDLE run correctly, or maybe to reinstall it a different way so that it actually opens?

Why is this command need to for PIP "py -m pip install <package-name>

Why is this command need to for PIP "py -m pip install
I tried multiple times from visual studio but the only method to get it to work was from the terminal/cmd
There are a few components to this command:
py.exe is a global command on Windows (when installed) that will automatically select the latest version of Python. It is like using C:\Users\username\AppData\Local\Programs\Python\Python37\python.exe but without having to type it every time.
-m pip is an option for Python that essentially means "find and run pip for me"
install … are options for pip
Because the first step is running an executable, you need to do that from a program that allows you to run executables. Typically, this would be Explorer, the Start Menu, or Command Prompt/Powershell. If you are already using Visual Studio, you will need to switch to one of these programs to run this particular command.
However, Visual Studio itself offers ways to install Python packages without using this particular command. There is full information in the documentation, but if you selected "Python" when installing it then you will have a Python Environments window (look under the View / Other Windows menu).
That dropdown that currently says "Overview" in the screenshot also has a "Packages" view. If you look at that, it handles the first two components of your original command for you - it will find the right version of Python and be able to run pip. There is a text box where you can type the name of packages to install.
Under the hood, all Visual Studio is really doing is running python -m pip install <whatever you type>, so it isn't doing anything special compared to the py command. But it is an alternative to switching to a terminal if you want to stay in VS.

Running PIP install with pythonw makes console scripts use pythonw instead of python

(windows 7 pro, python 2.7, PIP 9.0.1)
During the deployment process of our tools on client workstations, I use pip to install custom python libs. Because of the way it is packaged, I cannot have a pip.exe, so I run the pip module with pythonw to avoid the popping of a console.
$ c:\installdir\pythonw.exe -m pip install mylib --index http://pypi.intranet.org
mylib has a console entrypoint (let's call it mylibutil) defined in the setup.py file. So a mylibutil.exe is generated at install time which is fine.
But when I run it, nothing happens in my console. After parsing the content of the generated executable, I saw that the python used to run the script is c:\installdir\pythonw.exe, so not the correct one for a console script, but indeed the same one that was used when calling PIP.
Is there any workaround? Is this a win-specific bug of PIP?
I can use python instead of pythonw at install time, that would be alright, but I know the popping consoles can frighten some of the users sometimes.
NOTE: I found this trick to wrap my python call through a no-console VBS script. So that's a workaround. However, I'd like it to keep things simpler if possible.

get-pip.py raises ValueError when run in IDLE

enter image description hereI need to install PIP for Python 2.7.3.
I have run the get-pip.py file in Python IDLE shell. However, it raises the following exception:
ValueError: Unable to configure handler 'console': closed
Here is the screenshot:
How can fix this error?
Here is the error faced when trying to execute python get-pip.py in the command prompt:
inspite of correct path no execution result
You need to run Python as an elevated process in order to have write access to the program files directory where pip will get installed. The simplest and best way to do that is to launch an elevated command prompt cmd.exe.
In Windows 7 and later, you can best do that by opening the start menu using the Windows key, and then typing cmd. This should give you the command prompt as the first result. Right click on it, and choose “Run as administrator”. After accepting the UAC dialogue, this will then start an elevated command prompt with proper write access.
The run the script, then use the following command as explained in the pip installation manual:
python get-pip.py
Of course you need to adjust the path to the get-pip.py file. For example if the file is in your downloads folder, you can write the following:
python C:\Users\<username>\Downloads\get-pip.py
This should the properly install pip for the current Python version.
Note that in order to use pip later, you also need to run it always from an elevated command prompt, as every PyPI module is also installed into the Python directory in your program files (unless you’re using virtual environments of course). So you then need to run e.g. pip install beautifulsoup4. If pip.exe is not in your path, which likely be the case, you can also run pip using the Python executable like this: python -m pip install beautifulsoup4.

pip doesn't work in Eclipse on Windows 8 (Python 3.4)

When I try to type "pip install " or "easy_install ", Python can't recognize the commands (I get a name error). My system's Path variable is "C:\Python34\Scripts;C:\Python34". I've tried to use pip through the Python command line as well as Eclipse with the PyDev module. I know pip is supposed to come installed with Python 3.4. What's going wrong?
To run pip under Windows, you need to use the Windows command line program cmd.exe. Open the Run dialog with WinR, then type cmd and hit Enter. The command line will open up, and you should be able to type, for example, pip install requests to install the requests module.

Categories

Resources