Categories
Mastering Development

ImportError: cannot import name ‘NoReturn’ PyTorch on MacOS Catalina

I’m having this weird problem in running torchvision in macOS Catalina. Here’s the traceback Traceback (most recent call last): File "/Users/xdriyad/PycharmProjects/Resnet/main.py", line 1, in <module> from model import ResNet50 File "/Users/xdriyad/PycharmProjects/Resnet/model.py", line 1, in <module> import torch File "/Users/xdriyad/PycharmProjects/Resnet/env/lib/python3.6/site-packages/torch/__init__.py", line 573, in <module> import torch.quantization File "/Users/xdriyad/PycharmProjects/Resnet/env/lib/python3.6/site-packages/torch/quantization/__init__.py", line 9, in <module> from .quantize_fx import * […]

Categories
Mastering Development

Numpy in SPSS 22

I’m running SPSS 22.0.0.1 (64 bit edition) under Linux Mint 20 Ulyana (kernel 5.4.0-62-generic x86_64 GNU/Linux). Now I want to use python models not shipped with the "private" SPSS python edition. The private Python version shipped with my version of SPSS is 2.7.1. Running the code below from SPSS syntax gives the private python version. […]

Categories
Raspberry Pi User Help

import Spacy on RPI in Pycharm and other IDE gives error

I successfully installed Spacy using pip install spacy and alternatively through Pycharms virtual env, but when I import spacy in my program it’s giving me the following error; home/pi/.virtualenvs/cv/bin/python /home/pi/PycharmProjects/testSpeech/main.py Traceback (most recent call last): File "/home/pi/PycharmProjects/testSpeech/main.py", line 2, in <module> import spacy File "/home/pi/.virtualenvs/cv/lib/python3.7/site-packages/spacy/__init__.py", line 10, in <module> from thinc.neural.util import prefer_gpu, require_gpu File […]

Categories
Raspberry Pi User Help

import Spacy on RPI in Pycharm and other IDE gives error

I successfully installed Spacy using pip install spacy and alternatively through Pycharms virtual env, but when I import spacy in my program it’s giving me the following error; home/pi/.virtualenvs/cv/bin/python /home/pi/PycharmProjects/testSpeech/main.py Traceback (most recent call last): File "/home/pi/PycharmProjects/testSpeech/main.py", line 2, in <module> import spacy File "/home/pi/.virtualenvs/cv/lib/python3.7/site-packages/spacy/__init__.py", line 10, in <module> from thinc.neural.util import prefer_gpu, require_gpu File […]

Categories
Database Development

(PostgreSQL 11) Reading in an array of JSON objects (or composite types) from a CSV file into Postgres

So I am trying to import rows into a table using a CSV file, but have been running into problems I haven’t been able to solve. I would like one column of a row to be an array of JSON objects. How I would generally like my table to look like: statement_id INT statement VARCHAR(100) […]

Categories
Mastering Development

getting NameError when tries to migrate mySQL database into django project

I have a django – mySQL migration problem. I can not figure out what is the problem, please if you have any idea let me know. I try to change the basic sqlite3 database to mySQL. I started a new django project. I work on mac, I use virtual env and my python version 3.9.0. […]

Categories
Mastering Development

How do I install pygame for a new version of idle? (Windows)

I installed a new version of IDLE, and I’m trying to install Pygame. I tried to use the pygame module, but when I did, the error message Traceback (most recent call last): File "C:\Users\Kids\Desktop\Pygame Space Invaders\assets\Pygame_Space_Invaders.py", line 2, in import pygame ModuleNotFoundError: No module named ‘pygame’ showed up. I’m fairly sure this is because pygame […]

Categories
Mastering Development

How to use PyQt5 without a Virtual Environment

I recently tried to make an PyQt5 Web Browser. It kept on showing errors until I used a virtual environment to run the code. Now I want to run the code WITHOUT a virtual environment, but it just displays this error: Traceback (most recent call last): File "Browser.py", line 2, in <module> from PyQt5.QtCore import […]

Categories
Mastering Development

import matplotlib & Visual Studio Code

I’m using Visual Studio Code and want to be able to use numpy and matplotlib. The code I have is simply: import numpy import matplotlib.pyplot as plt The first line works fine, but the second line returns this error: Traceback (most recent call last): File "c:\Users\(username)\OneDrive\College\Code\Python\test.py", line 2, in <module> import matplotlib.pyplot as plt File […]

Categories
Mastering Development

Python: Flask import failing

I’m trying to deploy a Flask app on Apache using mod_wsgi. Im using a virtual environment. But the below line is failing. from flask import Flask Error: [Wed Sep 23 07:58:50 2020] [error] [client 10.192.73.242] mod_wsgi (pid=6937): Target WSGI script ‘/var/www/sample_rest/sample_rest.wsgi’ cannot be loaded as Python module. [Wed Sep 23 07:58:50 2020] [error] [client 10.192.73.242] […]