python-3.6

Jupyter Lab and Notebook Problem: Kernel Error

Jupyter Lab and Notebook Problem: Kernel Error Question: It appears that somehow one of my kernels is deleted. And perhaps that’s why I am getting this error. How could I possibly fix it? Can I reinstall something (the kernel in the base environment perhaps)? If no better option is available, I would try reinstalling anaconda …

Total answers: 3

How to fix "Can't find a default Python" error

How to fix "Can't find a default Python" error Question: I am using python in a windows server(64 bit) and it is installed by another user in his own directory in C:useruserxAppDataLocalProgramsPythonPython36 All other users (excluding me) are able to run Python files on this server. I get the following error when I run a …

Total answers: 8

Python with Django Import error with RegistrationSupplementBase cannot import name 'ugettext_lazy'

Python with Django Import error with RegistrationSupplementBase cannot import name 'ugettext_lazy' Question: I’m updating a very old Django project and trying to use RegistrationSupplementBase but when importing I get this error message: File “/home/projectmachine/Desktop/project_rebuild/projectname/models.py”, line 11, in <module> from registration.supplements.base import RegistrationSupplementBase File “/home/projectmachine/.local/share/virtualenvs/projectname-QrYA9Qp-/lib/python3.6/site-packages/registration/supplements/base.py”, line 9, in <module> from django.utils.text import ugettext_lazy as _ ImportError: …

Total answers: 1

embed python environment in c++ application

embed python environment in c++ application Question: Using the c-python api I try to embed python 3.6 into a c++ application. However instead of using the system install i’d like to use a virtual environment. I didn’t find any documentation on the way to do that. Some related documentation mention py_SetProgramName or py_SetPythonHome Also when …

Total answers: 2

ModuleNotFoundError: No module named 'distutils.core'

ModuleNotFoundError: No module named 'distutils.core' Question: I’ve recently upgraded from Ubuntu 18.04 to 19.04 which has python 3.7. But I work on many projects using Python 3.6. Now when I try to create a virtualenv with Python 36 in PyCharm, it raises: ModuleNotFoundError: No module named ‘distutils.core’ I can’t figure out what to do. I …

Total answers: 6

Error with TKinter Attribute Simpledialog

Error with TKinter Attribute Simpledialog Question: I’m currently trying to write in a few basic user input boxes using the tkinter module in Python 3.6 (via Spyder). I can confirm that the module loads, and that the option to select simpledialog comes up, but I keep getting the following error: AttributeError: module ‘tkinter’ has no …

Total answers: 2

AttributeError: module 'asyncio' has no attribute 'create_task'

AttributeError: module 'asyncio' has no attribute 'create_task' Question: I’m trying to asyncio.create_task() but I’m dealing with this error: Here’s an example: import asyncio import time async def async_say(delay, msg): await asyncio.sleep(delay) print(msg) async def main(): task1 = asyncio.create_task(async_say(4, ‘hello’)) task2 = asyncio.create_task(async_say(6, ‘world’)) print(f"started at {time.strftime(‘%X’)}") await task1 await task2 print(f"finished at {time.strftime(‘%X’)}") loop = …

Total answers: 2

virtualenvwrapper.sh crashes shell

virtualenvwrapper.sh crashes shell Question: I am following the install instructions for virtualenvwrapper, described here. I have used pip install virtualenvwrapper and it installed at the path /home/.pyenv/shims/. But when I run the command source /home/.pyenv/shims/virtualenvwrapper.sh the whole Konsole shuts down. I had previously put the command in the .bashrc file and almost broke Linux because …

Total answers: 7