Comments (8)
There are no plans to release 5.0.1, as there is no full python 3.10 support yet.
from pyq.
After first problem fixed, there is second problem.
$ python3.10 -mpip list
Package Version
---------- -------
attrs 21.2.0
coverage 6.0
iniconfig 1.1.1
numpy 1.21.2
packaging 21.0
pip 21.2.4
pluggy 1.0.0
py 1.10.0
pyparsing 2.4.7
pyq 5.0.0
pytest 6.2.5
pytest-cov 3.0.0
pytest-pyq 1.2.0
setuptools 58.2.0
toml 0.10.2
tomli 1.2.1
wheel 0.37.0
$ pyq -mpip list
/Users/user/.virtualenvs/310/bin/pyq: No module named pip
I believe we saw this kind of issues before, but can't recall if it was addressed. It was related to the virutalenv and venv modules, how they are now implemented... which breaks logic PyQ relies on.
from pyq.
Interestingly:
$ QHOME=$VIRTUAL_ENV/q $VIRTUAL_ENV/q/m64/q
...
q)p)import numpy
q)p)import pytest
q)p)import pip
q)p)print(pip.__file__)
/Users/user/.virtualenvs/310/lib/python3.10/site-packages/pip/__init__.py
q)p)print(sys.executable)
/Users/user/.virtualenvs/310/bin/pyq
q)p)print(sys.path)
['/usr/local/Cellar/python@3.10/3.10.0_1/Frameworks/Python.framework/Versions/3.10/lib/python310.zip', '/usr/local/Cellar/python@3.10/3.10.0_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10', '/usr/local/Cellar/python@3.10/3.10.0_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/lib-dynload', '/Users/user/.virtualenvs/310/lib/python3.10/site-packages']
q)p)print(sys.prefix)
/Users/user/.virtualenvs/310
q)p)print(sys.exec_prefix)
/Users/user/.virtualenvs/310
but
$ pyq
Python 3.10.0 (default, Oct 6 2021, 01:11:32) [Clang 13.0.0 (clang-1300.0.29.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.executable
'/Users/user/.virtualenvs/310/bin/pyq'
>>> sys.path
['', '/usr/local/Cellar/[email protected]/3.10.0_1/Frameworks/Python.framework/Versions/3.10/lib/python310.zip', '/usr/local/Cellar/[email protected]/3.10.0_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10', '/usr/local/Cellar/[email protected]/3.10.0_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/lib-dynload']
>>> sys.prefix
'/usr/local/Cellar/python@3.10/3.10.0_1/Frameworks/Python.framework/Versions/3.10'
>>> sys.exec_prefix
'/usr/local/Cellar/python@3.10/3.10.0_1/Frameworks/Python.framework/Versions/3.10'
from pyq.
NB: mapping import was fixed in the internal MR 746, which is planned to be released as 5.0.1...
from pyq.
Hi Aleks - is there a plan for 5.0.1 to be released any time soon? the default version of python on ubuntu 22.04 LTS is 3.10 so others may start running into this issue as upgrades begin to occur. Cheers!
from pyq.
Is there anyway to force pyq to use a different version of python? My default version of python is 3.9 using update-alternatives however when I run pyq it tries to still use 3.10
CPUS=24 pyq
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/murray/.local/lib/python3.10/site-packages/pyq/__init__.py", line 4, in <module>
from collections import Mapping as _Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py)
'2022.08.15T08:58:06.931 python
[5] /home/murray/q/p.k:7: p)from pyq import q
^
[2] /home/murray/q/python.q:1: \l p.k
python --version
Python 3.9.13
python3 --version
Python 3.9.13
from pyq.
Use virtualenv with python3.9 and install PyQ in there as described in the installation guide.
from pyq.
After spending hours earlier this week in order to rewrite Python initialization for 3.10 and failing, I came up with a quick workaround for the importing modules installed in the virtual environment when using Python 3.10 and PyQ:
$ pyq
Python 3.10.5 (main, Jul 25 2022, 15:52:08) [GCC 11.2.1 20220219] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import markdown
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/user/.virtualenvs/3/lib/python3.10/site-packages/pyq/__init__.py", line 820, in __import__
m = _imp(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'markdown'
Unfortunately, due to Python Initialization changes in 3.10, sys.path is not properly initialized when Python is loaded from kdb+. Dirty workaround is to extend sys.path
to what it should have been:
>>> import sys
>>> sys.path.extend(['/home/user/.virtualenvs/3/lib/python3.10/site-packages', '/usr/lib/python3.10/site-packages'])
>>> import markdown
>>> markdown.__version__
'3.3.4'
Basically, first path is your $VIRTUAL_ENV/lib/python3.10/site-packages
, and second path is where system python 3 packages are installed.
from pyq.
Related Issues (20)
- [Windows] fail to load HOT 14
- pip install pyq fails HOT 2
- Pyq on 64-bit Centos 7 failes with Invalid ELF header HOT 2
- pyq doesn't run faster parallelly HOT 2
- Using PyQ in PyCharm in Windows HOT 8
- No module named 'pyq' in macOs Catalina 10.15.4 HOT 5
- q can't find python package in virtual env HOT 20
- pandas 1.0.3 incompatibility HOT 10
- Running a background q timer within an IPython session HOT 4
- stdout from Python is always behind stdout from Q when direct stdout to a file HOT 2
- PyQ 5.0 conda release for python 3.6 HOT 4
- Best practices for read only QHOME HOT 2
- support for .z.pi HOT 4
- What's The Proper Way To Add A Column To q() Table, From Python List or NumpyArrary? HOT 2
- Unable to install pyq on py3.6 venv HOT 1
- Running pyq in terminal resulting in exit .pyq.run line of code executing from python.q file HOT 5
- Async messages get queued until sync message HOT 1
- installation error: subprocess-exited-with-error HOT 1
- Is there a way to have q syntax highlighting in cells starting with `%%q` in jupyter notebook? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyq.