Category : ipython

[OS info: 5.14.14-arch1-1 x86_64 GNU/Linux] After creating a Python v3.7.0 virtual-env with Pyenv, with the –no-site-packages option, I install packages with pip, using: $ python -m -pip install <package-name> An example is either Pandas v1.1.5 or Torch v1.7.0+cpu installed in the virtual-env. Then, starting a Python 3.7.0 shell in console, simply by issuing python in ..

Read more

How to set the image size to display? Running in VSCode Jupyter Interactive Window from PIL import Image from IPython.display import display display(Image.open(‘imageURL’)) This code displays the Image as it is, i.e showing the original size, Tried this, which works, but how to keep the ratio, image shrunks as it is image = Image.open(‘imageURL’) image ..

Read more

When running: import requests requests.get("https://github.com") I get the following error: Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)’))) If however i run the same command in iPython the command runs with no error. I also checked the path to the certificate for ..

Read more

I am trying to start a process using the multiprocessing.Process example from the python documentation. Here is the example code: from multiprocessing import Process import os def info(title): print(title) print(‘module name:’, __name__) print(‘parent process:’, os.getppid()) print(‘process id:’, os.getpid()) def f(name): info(‘function f’) print(‘hello’, name) if __name__ == ‘__main__’: info(‘main line’) p = Process(target=f, args=(‘bob’,)) p.start() ..

Read more

I worked already with jupyter notebook but now I move to pycharm editor so I convert .ipynb file to .py script file. In my Jupyter notebook %config InlineBackend.figure_format = ‘retina’ After converting to .py script file in pycharm it shows as get_ipython().run_line_magic(‘config’, "InlineBackend.figure_format = ‘retina’") I got the following error in pycharm for this line ..

Read more