You can use environment variable PYTHONPATH to prepend search paths to the default, eg I add in .profile export PYTHONPATH=$HOME/python_module
in python session, >>> sys.path ['', '/home/bill/python_module', '/usr/lib/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6/lib-dynload', '/usr/local/lib/python3.6/dist-packages', '/usr/lib/python3/dist-packages'] >>> Пн, 19 фев 2018, Gilles Kirouac написал(а): > I had j806/j64/windows, I installed Python 3.6.4 today for my single use > (rather than all users). > > I then had difficulty with "import j". > > "put j.py and j_config.py where python can find them" > I initially placed them with other scripts under Tools\scripts, but that > did not work. > Putting them in the Python36 directory along python.exe works. Is this > the right place? It is just my guess! > > I had to modify the j_config.py file to: > > pathbin= r'C:\users\xxxxx\j64-806\bin' > pathdll= pathbin+'\j.dll' > pathpro= pathbin+'\profile.ijs' > > Note the "r" in pathbin. r=raw to avoid having python interpret \u as a > unicode sequence leader. > > The numpy module was not installed. To install it, in a windows shell: > pip install numpy > > My session then looks fine to me: > > Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit > (AMD64)] on win32 > Type "copyright", "credits" or "license()" for more information. > >>> import j > >>> j.init(True) > >>> j.do('abc=: i.2 3') > 0 > >>> q= j.get('abc') > >>> j.set('ghi',23+q) > >>> j.get('ghi') > array([[23, 24, 25], > [26, 27, 28]], dtype=int64) > >>> j.do('+a.') > 3 > >>> j.getlasterror() > b'|domain error\n| +a.\n' > >>> j.test() > b'nib/608-46j/notuom/sresu/:c' > > [[0 1 2] > [3 4 5]] > > [[0.5 1.5 2.5] > [3.5 4.5 5.5]] > b'|domain error\n| +a.\n' > array([1, 1, 1], dtype=int64) > >>> j.set('foo','wert') > >>> j.get('foo') > b'wert' > >>> > > ~ Gilles > > Le 2018-02-19 à 14:39, Eric Iverson a écrit : > > The python3 addon has been updated with bug fixes. Please share your > > experiences with this new facility. > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm -- regards, ==================================================== GPG key 1024D/4434BAB3 2008-08-24 gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3 gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm