Skip to content
Advertisement

Tag: path

How to migrate all packages, settings, user data etc. after updating to a newer Python version?

I’ve just installed Python 3.10 on Windows 10 and none of my scripts are working. For instance, when doing jupyter notebook I get I’ve been using Python 3.9 and all the scripts are still located in C:Program FilesPython39Scripts. However, there is nothing in C:Program FilesPython310Scripts (besides pip). As a first attempt to solve the problem, I uninstalled Python 3.10 leaving

Location for Python version on macOS (using universal-installer for 3.10.5)

My very first post here, as new comer to MacOS and Python. Recently installed python 3.10.5 via macOS 64-bit universal2 installer .pkg file downloaded from python.org > Downloads > mac OS on MacOS 12.4 [M1/Apple Silicon]. In terminal, the command python3 shows the version as 3.10.5. But echo $PATH is giving me a path leading to /Library/Frameworks/Python.framework/Versions/3.10/bin I was expecting

Accessing script file location from an external file python

I have the following bizarre set up. Consider 3 scripts in different directories: root1/folderA/scriptA.py root2/folderB/scriptB.py root2/folderC/scriptC.py The first file and it’s location are fully modifiable. The second and third are completely fixed. scriptA.py contains a parent class: scriptB.py contains a child class: scriptC.py contains the code to execute: In scriptC.py what I want is the behaviour to get the path

Import functions from another directory

I am running a python script (app.py) where I have to use two functions from another script (src.py), located inside another directory. The structure is the following: I am using, in app.py, the following lines: to access to the functions odd_all, even_all declared inside src.py. However, I get the error: ModuleNotFoundError: No module named ‘src’. How could I solve this

All possible combinations of a list of tuples

I’m creating “Boggle” in python, and I have a list of tuples that represent coordinates on a game board: I’m trying to create a new list of lists of tuples that will represent all possible paths on the board. It’d look something like this: I tried using itertools.combinations and itertools.permutations but it doesn’t seem to do the job, for example

Advertisement