Why can't I install a library with a minus sign in it? - events

I'm new to Python and I'm trying to import a module that I installed, "python-evtx". I successfully installed it, but when I try to import it in the environment (Python 3.10.9) using Idle I get a syntax error that points at the "-" sign. As far as I can tell, import chokes on that"-" sign. Can anybody help? Thanks!
Here is a screenshot of my issue:
(https://i.stack.imgur.com/h9oxj.png)

Related

shiboken2 & PySide2 issues

I get this error when trying to run a PyQt5 Application, I keep getting it and I think it's when I use pyuic5 to export code from QT Designer and then try to run it.
from .shiboken2 import *
ImportError: DLL load failed: The specified procedure could not be found.
I have used pip freeze to find the versions of shiboken2 and pyside2 and they are both the same version.
I installed Python 3.7 + And it works.

How to import Prolog from pwsip

I tried running this code in VISIO CODE STUDIO:
from pyswip import Prolog
from tkinter import *
from tkinter import messagebox
and I got an error. what am I doing wrong? Thanks.
It looks like you don't have pySwip installed, or at least it cannot be found.
I tried
https://pypi.org/project/pyswip/
Were one reads:
WARNING! PySwip has no Windows installers! If you are a Windows user,
see INSTALL. There are some "free download" sites that claim to be
hosting PySwip installers. DO NOT TRUST THEM!
They have an INSTALL.md but clicking on that just leads to a 404.
but you can get it from github:
https://github.com/yuce/pyswip/blob/master/INSTALL.md
You are on Windows, so:
Make sure swipl executable is on the PATH.
Run pip install pyswip

pypiwin32 alternatives for Mac

Is there an alternative for pypiwin32 on Mac?
I'm doing a tutorial on how to create a chatbot, however I keep getting an import error. I was given advice to install pypiwin32 but soon realized it only works for windows and not on osx. Below is the code for the chatbot where I get the import error on.
import speech_recognition as sr
import pyttsx3
try:
engine = pyttsx3.init()
except ImportError:
print("Requested driver is not found")
except RuntimeError:
print("Driver failed to initialize")
voices = engine.getProperty('voices')
for voice in voices:
print(voice.id)
I don't think there is an alternative to pypiwin32 for OSX, maybe you can share what your error is so we can help you that way?
Not an answer but I can't comment yet...
If you are running it on mac OSX, you need to additionally install:
pip install pyobjc
it will work. I had tried the following:
import pyttsx3
engine = pyttsx3.init('nsss')
voices = engine.getProperty('voices')
after installing pyobj and it is working now :)

import tensorflow SyntaxError: invalid syntax

Using Virtualenv on Mac I have encountered the showing SyntaxError when I
import tensorflow
I tried many times uninstall but now working... please help me!
Tensorflow is not supported on Python 3.7. You'll need to use python3.6 or earlier.
async which was fine as a variable name in earlier versions of Python, is a keyword in Python 3.7. This is why it is failing to import.

Problems setting up pySDL2 on mac os x 10.9

I am having trouble setting up PySDL2 on my macbook pro running OSX 10.9. I downloaded and installed SDL 2.0.1 and I am trying to follow the PySDL2 tutorial here: http://pysdl2.readthedocs.org/en/latest/integration.html
I do not know what to do when it says "it is also possible to set the environment variable PYSDL2_DLL_PATH, which shall point to the directory of the SDL2 library." I tried running "export PYSDL2_DLL_PATH=/Library/Frameworks", but I don't know if that's what I'm supposed to do. Currently when I try to run this code:
import sys
try:
import sdl2.ext as sdl2ext
except ImportError:
import traceback
traceback.print_exc()
sys.exit(1)
from sdl2.ext import Resources
RESOURCES = Resources(__file__, "resources")
I get the error "ImportError: No module named 'sdl2'"
So how do I properly set this up?
Edit: Using macports I got things setup correctly. Thank you sirs.
Have you tried installing it via macports?
$ sudo port install py-SDL

Resources