analitics

Pages

Showing posts with label pip3. Show all posts
Showing posts with label pip3. Show all posts

Thursday, October 26, 2023

News : Django 5.0 beta 1 released.

Django 5.0 beta 1 is now available. It represents the second stage in the 5.0 release cycle and is an opportunity for you to try out the changes coming in Django 5.0.
Django 5.0 brings a deluge of exciting new features which you can read about in the in-development 5.0 release notes.
This can be easily install with the pip3 tool:
pip3 install Django==5.0b1
Collecting Django==5.0b1
...
Installing collected packages: tzdata, sqlparse, asgiref, Django
Successfully installed Django-5.0b1 asgiref-3.7.2 sqlparse-0.4.4 tzdata-2023.3

Saturday, January 28, 2023

Python : Fix error with pip and pylupdate6.exe .

I try to upgrade the PyQt6 package and I got this error:

pip3 install --upgrade --force-reinstall PyQt6
...
ERROR: Could not install packages due to an OSError: [WinError 2] The system cannot find the file specified:
...pylupdate6.exe
...pylupdate6.exe.deleteme'
I think this solution will work for any python package
Open a command shell run as administrator and run it again:
pip3 install --upgrade --force-reinstall PyQt6
Collecting PyQt6
...
Successfully installed PyQt6-6.4.1 PyQt6-Qt6-6.4.2 PyQt6-sip-13.4.1
If you want to re-download the packages instead of using the files from your pip cache, then use:
pip install --force-reinstall --no-cache-dir

Tuesday, January 24, 2023

Python : Fix DLL load failed while importing ...

This error DLL load failed while importing ... can have many causes like conflicts with the already installed packages, and also it can break your current environment.
>>> import PyQt6
>>> from PyQt6.QtCore import QUrl
Traceback (most recent call last):
  ...
ImportError: DLL load failed while importing QtCore: The specified module could not be found.
You can see I used to reinstall the PyQt6 python package with this argument --ignore-installed:
pip3 install PyQt6 --user --ignore-installed
Collecting PyQt6
  ...
Installing collected packages: PyQt6-Qt6, PyQt6-sip, PyQt6
  WARNING: The scripts pylupdate6.exe and pyuic6.exe are installed in
  ...
  which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed PyQt6-6.4.0 PyQt6-Qt6-6.4.2 PyQt6-sip-13.4.0
The --ignore-installed option for the pip package manager was first introduced in version 6.0, which was released in April 2014.
The old install give me this error and when I try to use I got this:
>>> from PyQt6 import *
>>> dir(PyQt6)
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__']
Now after I reinstall with this option the result is good:
>>> import PyQt6
>>> from PyQt6 import QtCore
>>> dir(PyQt6)
['QtCore', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'sip']
>>> from PyQt6.QtCore import QUrl

Monday, December 19, 2022

Python 3.10.2 : MoviePy - part 001.

MoviePy is a Python module for video editing, which can be used for basic operations (like cuts, concatenations, title insertions), video compositing (a.k.a. non-linear editing), video processing, or to create advanced effects. It can read and write the most common video formats, including GIF.
You can read more about this python package on this webpage.
I install this python package with the pip3 tool:
pip3 install MoviePy --user
I have an AVI file type created with the Blender 3D software, named anime_effect_001.avi, you can find it on my youtube channel.
I used this source code to convert it into an mp4 file type:
import moviepy.editor as moviepy
clip = moviepy.VideoFileClip("anime_effect_001.avi")
clip.write_videofile("MP4_anime_effect_001.mp4")
I run with this command:
python moviepy_001.py
Moviepy - Building video MP4_anime_effect_001.mp4.
Moviepy - Writing video MP4_anime_effect_001.mp4
...
Moviepy - Done !
Moviepy - video ready MP4_anime_effect_001.mp4
I play the MP4 file with the VLC video player and works great.

Saturday, December 17, 2022

Python 3.10.2 : Suite for Computer-Assisted Music in Python known as SCAMP.

SCAMP is an computer-assisted composition framework in Python designed to act as a hub, flexibly connecting the composer-programmer to a wide variety of resources for playback and notation. SCAMP allows the user to manage the flow of musical time, play notes either using FluidSynth or via MIDI or OSC messages to an external synthesizer, and ultimately quantize and export the result to music notation in the form of MusicXML or Lilypond. Overall, the framework aims to address pervasive technical challenges while imposing as little as possible on the aesthetic choices of the composer-programmer.
Let's install with pip3 python tool in Windows O.S..
pip3 install --user scamp
I created a python script named music001_test001.py with this source code:
from scamp import *
import random

s = Session()

guitar = s.new_part("Guitar")

text = "this is a test text"

for char in text:
    if char == " ":
        wait(0.2)
    elif char.isalnum():
        for x in range (0,10):
            guitar.play_note(ord(char) - random.randrange(50, 75), random.randint(0,5), random.random()/5)
    else:
        wait(0.2)
        guitar.play_note(ord(char), 0.8, 0.06)
        wait(0.2)
The source code is easy to understand. I use random to play into for loop.
I play these with preset Jazz Guitar for Guitar.
I could say that the result is quite good for the random function.
In my internet searches, I also found a rather interesting PDF file about this Python module and other enhancements. You can find it here.