API help

I’m trying to install joplin-api in PyCharm which fails. I’ve tried in a powershell and get a similar error.

Here is the error I receive with some redaction:

ERROR: Command errored out with exit status 1: ‘C:\Users…\venv\Scripts\python.exe’ -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"‘C:\Users…\AppData\Local\Temp\pycharm-packaging\immutablessetup.py’"’"’; file=’"’"‘C:\Users…\AppData\Local\Temp\pycharm-packaging\immutablessetup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ install --record ‘C:\Users…\AppData\Local\Temp\pip-record-weg7w0b_\install-record.txt’ --single-version-externally-managed --compile --install-headers ‘C:\Users…\venv\include\site\python3.6\immutables’ Check the logs for full command output.

With powershell:

ERROR: Command errored out with exit status 1:
command: ‘c:\program files (x86)\python36-32\python.exe’ -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"‘C:\Users\…\AppData\Local\Temp\pip-install-2sd_3d1w\immutables\setup.py’"’"’; file=’"’"‘C:\Users\…\AppData\Local\Temp\pip-install-2sd_3d1w\immutables\setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ install --record ‘C:\Users…\AppData\Local\Temp\pip-record-e4132lzh\install-record.txt’ --single-version-externally-managed --user --prefix= --compile --install-headers ‘C:\Users…\AppData\Roaming\Python\Python36\Include\immutables’
cwd: C:\Users…\AppData\Local\Temp\pip-install-2sd_3d1w\immutables
Complete output (24 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.6
creating build\lib.win32-3.6\immutables
copying immutables\map.py -> build\lib.win32-3.6\immutables
copying immutables_testutils.py -> build\lib.win32-3.6\immutables
copying immutables_version.py -> build\lib.win32-3.6\immutables
copying immutables_init_.py -> build\lib.win32-3.6\immutables
running egg_info
writing immutables.egg-info\PKG-INFO
writing dependency_links to immutables.egg-info\dependency_links.txt
writing top-level names to immutables.egg-info\top_level.txt
reading manifest file ‘immutables.egg-info\SOURCES.txt’
reading manifest template ‘MANIFEST.in’
writing manifest file ‘immutables.egg-info\SOURCES.txt’
copying immutables_map.c -> build\lib.win32-3.6\immutables
copying immutables_map.h -> build\lib.win32-3.6\immutables
copying immutables_map.pyi -> build\lib.win32-3.6\immutables
copying immutables\py.typed -> build\lib.win32-3.6\immutables
running build_ext
building ‘immutables._map’ extension
error: Microsoft Visual C++ 14.0 is required. Get it with “Build Tools for Visual Studio”: https://visualstudio.microsoft.com/downloads/

ERROR: Command errored out with exit status 1: ‘c:\program files (x86)\python36-32\python.exe’ -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"‘C:\Users…\AppData\Local\Temp\pip-install-2sd_3d1w\immutables\setup.py’"’"’; file=’"’"‘C:\Users…\AppData\Local\Temp\pip-install-2sd_3d1w\immutables\setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ install --record ‘C:\Users…\AppData\Local\Temp\pip-record-e4132lzh\install-record.txt’ --single-version-externally-managed --user --prefix= --compile --install-headers ‘C:\Users…\AppData\Roaming\Python\Python36\Include\immutables’ Check the logs for full command output.

Thanks

Maybe @foxmask can help you out. Since the api is just a simple rest api you can also use the requests library in python to work with the api, no need for a library (although the library is really nice).

Here is a basic example

import requests

token = TOKEN_STRING_COPIED_FROM_WEBCLIPPER_PAGE
host = 'http://127.0.0.1:41184'

if requests.get("{}/ping".format(host)).text != u'JoplinClipperServer':
    print("Can not find Joplin Clipper service")
    exit()

params = {'token': token}
headers = {'Content-Type': 'application/json'}
notes = requests.get("{}/notes".format(host), params=params).json()
print(notes)

how do you install?
what do you enter?
can you enter
pip install httpx
?

I tried installing in PyCharm in settings, project interpreter as well as in a console as well as in a windows powershell. I cannot install httpx either. This says it requires Microsoft Visual C++ 14.0. Is httpx a dependency for joplin-api? It so, I guess I could install Microsoft Visual C++ 14.0. Thanks.

so it’s not an install problem with Joplin API nor httpx but with pychzrm or vscode (there is vscodium if you prefer not being tracked by Microsoft)
you should have a look a the vscode/pycharm faq to be able to install what you need

I solved this problems by installing Microsoft Visual C++ 14.0.