I was able to decode JWT in either CMD or PowerShell and get a JSON result:
pyjwt decode --no-verify eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
However, after re-installing Python a few times, this no longer works and I'm getting 'pyjwt' is not recognized as an internal or external command.
Things I've tried:
Reinstall Python 3.8.x from installer
Reinstall Python 3.8.x from Microsoft Store
Checked PATH Environment Variable to Python.exe
Reinstall PyJWT using pip install pyjwt
Tried installing pyjwt version 1.4.0, 1.7.1, and 2.0.1, same problem
Is there something I'm missing from my Environment Variables? I'm not sure why it's no longer working. http://pypi.org/project/PyJWT/1.7.1. shows this example under Decoding examples, and my command looks like the example.
Well
Try to add Python folder/Script to PATH by using instruction on this https://www.google.co.th/url?sa=t&source=web&rct=j&url=https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/&ved=2ahUKEwjM1fXu9pXwAhWyxTgGHeJKDpIQFjAKegQIGxAC&usg=AOvVaw0PG5BF3E1K_EAiJneUN07T
pip show pyjwt may show you where the package was installed. Then add whatever path that contains the pyjwt executable to your environment path variable
The command pyjwt has been dropped since 2.0.0:
https://github.com/jpadilla/pyjwt/blob/master/CHANGELOG.rst#v200
See "Drop CLI":
Dropped the included cli entry point
Related
I have upgrade from python 3.9.6 to 3.10.5 and kept thankfully the old version. This is on a Win-64 machine so should be using the WinVault backend (default)
I have copied all the site_packages from 3.9.6 to 3.10.5 (except for those already installed by the newer version)
Running keyring under 3.10.05 the error is
keyring.errors.NoKeyringError: No recommended backend was available. Install a recommended 3rd party backend package; or, install the keyrings.alt package if you want to use the non-recommended backends. See https://pypi.org/project/keyring for details.
I can run the same code under 3.9.6 with no problems.
Running
python -c "import keyring.util.platform_; print(keyring.util.platform_.config_root())"
or
python -c "import keyring.util.platform_; print(keyring.util.platform_.data_root())"
under either version is producing locations that don't really exist. I have created a keyringrc.cfg file with a keyring.backends.Windows.WinVaultKeyring line but it doesn't seem to do anything
I don't mind having to re-enter keyring passwords but would like to get this working under 3.10.5.
Ideas
This has eventually turned out to be needs to upgrade cffi which has fixed the problem.
I'm having trouble installing packages and using them in Pycharm. I've followed various threads (I'm new to Macs and seem to have tried everything) now I'm stuck.
In this case, I want to use the package xgboost.
I have brew installed, after launching a terminal using Rosetta:
%brew install xgboost
Warning: xgboost 1.3.3 is already installed and up-to-date.
It appears installed OK here:
/opt/homebrew/Cellar/xgboost
I also have Python installed here:
/opt/homebrew/Cellar/python#3.9
But no matter how I configure an Interpreter in Pycharm, I can't seem to get the package recognised.
Where have I gone wrong?
I am very unsure exactly how, but I've got this working.
Following: https://abbasegbeyemi.me/blog/homebrew-python-apple-m1
I changed the order of elements in my path:
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin
then a new interpreter in Pycharm using:
usr/local/Cellar/Python#3.9/3.9.2_2/bin/python3.9
Now I can install packages just using pip in pycharm and it works.
This has been 6 hours of pain - warning to anyone who isn't well versed in macs, setting up an M1 for python dev was a complete nightmare for me.
Docs: https://xgboost.readthedocs.io/en/latest/build.html
Pre-built binary wheel for Python
If you are planning to use Python, consider installing XGBoost from a pre-built binary wheel, available from Python Package Index (PyPI). You may download and install it by running
# Ensure that you are downloading one of the following:
# * xgboost-{version}-py2.py3-none-manylinux1_x86_64.whl
# * xgboost-{version}-py2.py3-none-win_amd64.whl
pip3 install xgboost
I'm running python 3.6 via anaconda 3, using Visual Studio Code.
I followed instructions like these (Interactive Brokers API install) and downloaded the package to a local directory of mine say: c:\dev\pyib, so now the code is in c:\dev\pyib\IbPy-master
I open that directory in command line and run
python setup.py install
All runs ok.
But then my program, which is in c:\dev\pyib says Module not found. (In my case ibapi). The linter is also showing red.
There is no other python installed on this pc.
Where did the package install to? and how do I check that? What will I find where the package installed itself to that shows me its there?
Or do I have to use a trial-and-error with the linter and sys.path.append()? (I tried that with the directory where the files are downloaded to - to no avail)
I'm trying to set up the PYTHONPATH using the "env" in launch.json from Visual Studio Code, as shown in this unaccepted answer.
Current sys.path:
'c:\\dev\\pyIb',
'C:\\Users\\user\\AppData\\Local\\Continuum\\anaconda3\\python36.zip',
'C:\\Users\\user\\AppData\\Local\\Continuum\\anaconda3\\DLLs',
'C:\\Users\\user\\AppData\\Local\\Continuum\\anaconda3\\lib',
'C:\\Users\\user\\AppData\\Local\\Continuum\\anaconda3',
'C:\\Users\\user\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-
packages',
'C:\\Users\\user\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\Babel-2.5.0-py3.6.egg',
'C:\\Users\\user\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\win32',
'C:\\Users\\user\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\win32\\lib',
'C:\\Users\\user\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\Pythonwin'
I deleted the ib directory and re-ran the install. The last line says: Writing C:\Users\user\AppData\Local\Continuum\anaconda3\Lib\site-packages\IbPy2-0.8.0-py3.6.egg-info So is the location of the egg-info the location of my undetected module? The actual folder in the site-packages is called ib.
Or could my problems be because of a difference in Lib vs. lib with the lowercase in the sys.path and the uppercase in the actual directory?
But the real question here is still: HOW DO I KNOW WHERE the package was installed what should I search for?
This answer is specific for anaconda3 Python and packages installed using python setup.py install (which is actually using distutils)
Take a look at anaconda3\Lib\site-packages you should see a directory for the package you installed.
The way to know for sure where your package is, is by doing a pip list then trying to pip uninstall and re-install again using the python setup.py install: Here are the detailed instructions:
When uninstalling, pip will tell you it cannot because it was done via distutils.
You'll get a message like this:
DEPRECATION: Uninstalling a distutils installed project (ibpy2) has been deprecated and will be removed in a future version.
This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
You'll be prompted to continue anyway. If you choose No, then you can find the directory in
C:\Users\<yourusername>\AppData\Local\Continuum\anaconda3\Lib\site-packages
Thanks to Emanuel Mtali for pointing me in the right direction
Some more information:
The problem I had was due to a stupid mistake of mine. I was running setup of a different (but related) package not used anymore. IbPy2 instead of TwsAPI. I was supposed to run the setup.py of the package installed via the latest version of the MSI from IB, and NOT the IbPy2 package. :-(
I am having trouble installing a wheel file via pip.
I open my command prompt
write the following in the prompt
C:/Python34/Scripts/pip install C:/Users/Hamsa/Downloads/pygame.whl
Then I get this message
pygame.whl is not a valid wheel filename. Storing debug log for failure in C:\Users\Hamsa\pip\pip.log
I don't what to do and I need your help.
You should correct name format for installing wheel file. Because wheel file name also includes many information such as the version of program, supported python version. Your command should be like the command below.
pip install pygame‑1.9.3‑cp34‑cp34m‑win_amd64.whl
If the answer suggested by #Harun doesnot work, try
python -m pip install <whl file name with complete path>.whl
If u have more than 1 Python versions installed , check which version of python is being used to install the package using:
python -v
Also refer to pygame readme for an official installation guide.
I am trying install imposm.parser library on python.
After I typed - pip install imposm.parser, it said it could not find protoc command.
but I have already got protobuf 2.6.1 library installed on python!? I don't understand.
Thanks
Andrew
You need to download Protocol Compiler separately from Protocol Buffers library. Get it from Google Developers Protocol Buffers Download page.
Most executables of python installed using pip (or easy install) are stored in the Scripts-subfolder of Python. In my case, this is C:\Python27\Scripts.
You should check, if your PATH-Environment containts that directory. Further information are already on this SO-question.