This document contains fixes for Qt/PySide6 import errors and missing system libraries when running pyqtgraph applications on Ubuntu.
If you're encountering Qt/PySide6 import errors, follow these steps:
- Install system libraries (run as root/admin):
This document contains fixes for Qt/PySide6 import errors and missing system libraries when running pyqtgraph applications on Ubuntu.
If you're encountering Qt/PySide6 import errors, follow these steps:
| # Inside the container, edit /root/.bashrc and add this at the very bottom: | |
| # --- Fix DISPLAY for IDE-attached shells --- | |
| # Prefer the newest X socket (usually the active desktop) | |
| for d in /tmp/.X11-unix/X*; do | |
| n="${d##*/X}" | |
| export DISPLAY=":$n" | |
| done | |
| import numpy as np | |
| import torch | |
| from torch import nn | |
| import tqdm | |
| def convNd(in_channels=1, out_channels=1, kernel_size=2, stride=1, padding=1, weight=None, bias=None): | |
| # These are filters or kernels | |
| if weight is None: | |
| weight = np.ones((out_channels, in_channels, *kernel_size)) | |
| # O,C,*kernel_size |
| # env [MDP environment] | |
| # nS [state_dim] | |
| # nA [action_dim] | |
| # env.TransitProb [state_dim x action_dim x state_dim] | |
| # env.TransitReward [state_dim x action_dim], Note: It maybe in shape [state_dim x action_dim x state_dim]. In such | |
| # case no need to expand dim. It can also be in the same [state_dim], then it is required to expand dim twice accordingly |
| # Value iteration compact | |
| # env [MDP environment] | |
| # nS [state_dim] | |
| # env.TransitProb [state_dim x action_dim x state_dim] | |
| # env.TransitReward [state_dim x action_dim], Note: It maybe in shape [state_dim x action_dim x state_dim]. In such |
| import copy | |
| from typing import Optional, Any, Union, Callable | |
| import torch | |
| from torch import Tensor | |
| from .. import functional as F | |
| from .module import Module | |
| from .activation import MultiheadAttention | |
| from .container import ModuleList | |
| from ..init import xavier_uniform_ |
| 1. I set this on my local machine and flip | |
| `alias port_map='f(){ ssh -N -L "$2":localhost:"$2" panditb@"$1".engr.oregonstate.edu; unset -f f; }; f'` | |
| 2. Enter into flip3 (use same node to re-establish connection to HPC if lost, eg '3' here) | |
| `ssh panditb@flip3.engr.oregonstate.edu` | |
| 3. Enter HPC and whatever node thereafter (For example if you connect to cn-gpu5, hostname will be gpu5). | |
| `ssh panditb@compute-{hostname}.hpc.engr.oregonstate.edu` | |
| 4. I start the jupyter on node |
| name: ml | |
| channels: | |
| - apple | |
| - defaults | |
| - conda-forge | |
| dependencies: | |
| - anyio=3.5.0 | |
| - aom=3.3.0 | |
| - appdirs=1.4.4 | |
| - appnope=0.1.2 |
./Miniforge3-MacOSX-arm64.shsource miniforge3/bin/activate(conda) is prepended in your command line. To make sure it is activated during terminal start-up. Use the following command.
conda initconda init zsh| conosle.log('Hello World'); |