Getting error on scons on hp ux to build simple helloworld app - scons

on HP UX I have installed scons for the first time and in the same folder I have a test.c which is a simple hello world printf executable.
when I try to run scons to build test.c it is failing by giving following error
$ scons
SCons import failed. Unable to find engine files in:
/usr/local/bin/../engine
/usr/local/bin/scons-local-3.0.1
/usr/local/bin/scons-local
/usr/local/lib/scons-3.0.1
/usr/local/lib/scons-3.0.1
/usr/lib/scons-3.0.1
/usr/local/lib/python2.7/site-packages/scons-3.0.1
/usr/local/lib/python2.7/site-packages/scons-3.0.1
/usr/lib/python2.7/site-packages/scons-3.0.1
/usr/local/lib/scons-3.0.1
/usr/local/lib/scons
/usr/local/lib/scons
/usr/lib/scons
/usr/local/lib/python2.7/site-packages/scons
/usr/local/lib/python2.7/site-packages/scons
/usr/lib/python2.7/site-packages/scons
/usr/local/lib/scons
Traceback (most recent call last):
"/usr/local/bin/scons", line 192, in module import SCons.Script
"/usr/local/lib/scons-3.0.1/SCons/Script/__init__.py", line 82, in module import SCons.Environment
"/usr/local/lib/scons-3.0.1/SCons/Environment.py", line 55, in module
import SCons.Platform
"/usr/local/lib/scons-3.0.1/SCons/Platform/__init__.py", line 53, in
module import tempfile
How can I get rid of these errors?

We finally got his fixed by downloading libz.so file from the net for hp ux. Thanks.

Related

GStreamer build windows cant import _giscanner

I'm trying to build GStreamer on windows using gst-build.
My environment:
Visual studio 2019 Professional
Python 3.9 64 bit
Meson 0.58.999
Ninja 1.10.2
the error message is:
>ninja -C build
ninja: Entering directory `build'
[1/30] Generating gir-glib with a custom command (wrapped by meson to set PATH)
FAILED: subprojects/gobject-introspection/gir/GLib-2.0.gir
[long list of python subprocess args with include patsh, c files etc]
Traceback (most recent call last):
File "C:\Work\GStreamer-build\source\gst-build\build\subprojects\gobject-introspection\tools\g-ir-scanner", line 98, in <module>
from giscanner.scannermain import scanner_main
File "C:\Work\GStreamer-build\source\gst-build\build\subprojects\gobject-introspection\giscanner\scannermain.py", line 35, in <module>
from giscanner.ast import Include, Namespace
File "C:\Work\GStreamer-build\source\gst-build\build\subprojects\gobject-introspection\giscanner\ast.py", line 29, in <module>
from .sourcescanner import CTYPE_TYPEDEF, CSYMBOL_TYPE_TYPEDEF
File "C:\Work\GStreamer-build\source\gst-build\build\subprojects\gobject-introspection\giscanner\sourcescanner.py", line 35, in <module>
from giscanner._giscanner import SourceScanner as CSourceScanner
ImportError: DLL load failed while importing _giscanner: The specified module could not be found.
ninja: build stopped: subcommand failed.
if I check the build directory:
So the file does build, but for some reason can't be imported.
I've seen from here that there were some changes to python 3.8 in how DLLs are searched for, but even if I manually open a python prompt in the parent directory and add both the parent and the giscanner directories to sys.path and using os.add_dll_directory I still can't import the module:
>>> import os,sys
>>> a = os.add_dll_directory(os.getcwd())
>>> a
<AddedDllDirectory('C:\\Work\\GStreamer-build\\source\\gst-build\\build\\subprojects\\gobject-introspection')>
>>> b = os.add_dll_directory(os.path.join(os.getcwd(),'giscanner'))
>>> b
<AddedDllDirectory('C:\\Work\\GStreamer-build\\source\\gst-build\\build\\subprojects\\gobject-introspection\\giscanner')>
>>> sys.path.insert(0, os.getcwd())
>>> sys.path.insert(0, os.path.join(os.getcwd(),'giscanner'))
further digging shows that pkg-config doesn't seem to know where to find gio, however that was also built sucessfully as part of the build so not sure why it doesn't know.
Unsure the actual problem, but the workaround is to revert Python to 3.7.9 (64 bit)
https://www.python.org/downloads/release/python-379
Its also been suggested you can build without that component using
-Dintrospection=disabled

cx_Freeze ConfigError: No file named C:\Python\Scripts\cxfreeze.exe\__main__.py (for module __main__)

I would like to create a .exe file of a file named ZCasinoinsulte.py located in C:\Python\Scripts. Moreoever, every time I execute cxfreeze ZCasinoinsulte.py it never works and tells me it does not find _main_.py in cxfreeze.exe.
Specs: I have python 3.9.1 on Windows 10 64bit.
I have installed cx_Freeze-6.5.1 with whl.
It does create an exe file, but it opens and shuts down instantly (even though I put os.system("pause") in ZCasinoinsulte.py).
old code
Any help would be appreciated :D
Edit: I have used the cxfreeze version 6.4.2 and the code runs better without errors. But the exe file closes as soon as I clic on it.
Here is my pip list traceback:
C:\Users\Hmili>pip list
Package Version
------------------ -------
cx-Freeze 6.4.2
importlib-metadata 3.4.0
pip 20.3.3
setuptools 49.2.1
zipp 3.4.0
Here is the traceback when I execute the exe file from cmd:
C:\Python\Mes fichiers python\dist>ZCasinoinsulte.exe
Traceback (most recent call last):
File "c:\python\lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 41, in run
module.run()
File "c:\python\lib\site-packages\cx_Freeze\initscripts\Console.py", line 36, in run
exec(code, m.__dict__)
File "ZCasinoinsulte.py", line 3, in <module>
File "c:\python\lib\site-packages\cx_Freeze\__init__.py", line 1, in <module>
import setuptools
File "c:\python\lib\site-packages\setuptools\__init__.py", line 24, in <module>
from setuptools.depends import Require
File "c:\python\lib\site-packages\setuptools\depends.py", line 6, in <module>
from .py33compat import Bytecode
File "c:\python\lib\site-packages\setuptools\py33compat.py", line 11, in <module>
from setuptools.extern.six.moves import html_parser
File "c:\python\lib\site-packages\setuptools\_vendor\six.py", line 92, in __get__
result = self._resolve()
File "c:\python\lib\site-packages\setuptools\_vendor\six.py", line 115, in _resolve
return _import_module(self.mod)
File "c:\python\lib\site-packages\setuptools\_vendor\six.py", line 82, in _import_module
__import__(name)
ModuleNotFoundError: No module named 'html.parser'
Here are the first ten lines of ZCasinoinsulte.py:
# -*-coding:Latin-1 -*
import os,time
from cx_Freeze import setup, Executable
from random import randrange
argent=3000
while argent>0:
condition1=0
condition2=0
argent=int(argent)
How do I resolve this? (Thanks for the help by the way :) )
I reverted cx_Freeze back to version 6.4.2, seemed to compile fine after that
pip install --upgrade cx-Freeze==6.4.2
Seems to be a bug or something.
First I downgraded pip as James Mackey advised me. The code ran properly and created an exe file. So the first issue was a comptability one.
Moreover, the exe file created crashed instantly when executed. From the traceback of the execution of ZCasinoinsulte.exe with cmd, James Mackey figured the third line of ZCasinoinsulte.py had an error related to it.
The third line of ZCasinoinsulte.py was:
from cx_Freeze import setup, Executable
I erased this line as it has nothing to do with the actual code.
I opened cmd and executed again the command: cxfreeze ZCasinoinsulte.py. The exe file now functions properly.

Tensorflow Object Detection API / ImportError: cannot import name 'keypoint_box_coder_pb2'

I followed instructions (https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md) to install the Tensorflow Object Detection
API. I use Anaconda on Windows 10 and all of the steps in the instructions seemed to complete OK.
But when trying to run python object_detection/builders/model_builder_test.py to test the installation, I get: ImportError: cannot import name 'keypoint_box_coder_pb2'
What am I missing?
(tensorflow) C:\Users\User\Documents\GitHub\models\research>python
object_detection/builders/model_builder_test.py Traceback (most recent
call last): File "object_detection/builders/model_builder_test.py",
line 21, in
from object_detection.builders import model_builder File "C:\Users\User\New\Anaconda3\envs\tensorflow\lib\site-packages\object_detection-0.1-py3.5.egg\object_detection\builders\model_builder.py",
line 18, in
from object_detection.builders import box_coder_builder File "C:\Users\User\New\Anaconda3\envs\tensorflow\lib\site-packages\object_detection-0.1-py3.5.egg\object_detection\builders\box_coder_builder.py",
line 21, in
from object_detection.protos import box_coder_pb2 File "C:\Users\User\New\Anaconda3\envs\tensorflow\lib\site-packages\object_detection-0.1-py3.5.egg\object_detection\protos\box_coder_pb2.py",
line 17, in ImportError: cannot import name
'keypoint_box_coder_pb2'
I got it to work. What I did was:
I ran:
protoc --python_out=. .\object_detection\protos\anchor_generator.proto .\object_detection\protos\argmax_matcher.proto .\object_detection\protos\bipartite_matcher.proto .\object_detection\protos\box_coder.proto .\object_detection\protos\box_predictor.proto .\object_detection\protos\eval.proto .\object_detection\protos\faster_rcnn.proto .\object_detection\protos\faster_rcnn_box_coder.proto .\object_detection\protos\grid_anchor_generator.proto .\object_detection\protos\hyperparams.proto .\object_detection\protos\image_resizer.proto .\object_detection\protos\input_reader.proto .\object_detection\protos\keypoint_box_coder.proto .\object_detection\protos\losses.proto .\object_detection\protos\matcher.proto .\object_detection\protos\mean_stddev_box_coder.proto .\object_detection\protos\model.proto .\object_detection\protos\optimizer.proto .\object_detection\protos\pipeline.proto .\object_detection\protos\post_processing.proto .\object_detection\protos\preprocessor.proto .\object_detection\protos\region_similarity_calculator.proto .\object_detection\protos\square_box_coder.proto .\object_detection\protos\ssd.proto .\object_detection\protos\ssd_anchor_generator.proto .\object_detection\protos\string_int_label_map.proto .\object_detection\protos\train.proto
What was missing was: .\object_detection\protos\keypoint_box_coder.proto
Then ran:
python setup.py build
python setup.py install
Then changed:
nets to research.slim.net in faster_rcnn_inception_resnet_v2_feature_extractor.py and faster_rcnn_resnet_v1_feature_extractor.py (in the models folder)
Ran:
python object_detection/builders/model_builder_test.py
Got:
Ran 11 tests in 0.195s
OK
It looks like you have not run
export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim # (from tensorflow/models/research folder)
in the same terminal before launching the test, have you ? If you've chosen the .bashrc option, you probably need to reload your bshrc filewith . ~/.bashrc

RISCV debug tests - 'gdbserver.py' fails for missing module

When I try to run the following in the /riscv-tests/debug directory
it fails.
./gdbserver.py --spike64 --cmd ../../bin/spike
Traceback (most recent call last):
File "./gdbserver.py", line 10, in
import targets
File "/home/dave/MyProjects/RiscV/build/riscv-tools/riscv-tests/debug/targets.py", line 4, in
import testlib
File "/home/dave/MyProjects/RiscV/build/riscv-tools/riscv-tests/debug/testlib.py", line 9, in
import pexpect
ImportError: No module named pexpect
I have searched the entire RISCV installation for "pexpect.py" with no success. I installed the complete RISCV toolchain. I can build code and run
the ISA simulator using spike and pk.
Looks like the problem is with my python installation. I found 'python-pexpect' in my Linux package manager and installed. But I am now having errors with other python system libraries.

vim74 with PyExc_OSError when importing python3 module

I have compiled vim with python3 support.
But when I type vim -c 'python3 import logging' in the bash, the vim can't execute the command correctly.
Error detected while processing command line:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.4/logging/__init__.py", line 26, in <module>
import sys, os, time, io, traceback, warnings, weakref, collections
ImportError: /usr/local/lib/python3.4/lib-dynload/time.cpython-34m.so: undefined
symbol: PyExc_OSError
I don't know the reason.
I figured this out! You can check this problem in vim more correctly by doing:
:python3 import time
The problem stems from the Python 3 build, caused by not enabling shared libraries. You can check if you have this problem:
vim$ python3 -c "import sysconfig; print(sysconfig.get_config_vars()['CONFIG_ARGS'])"
'--prefix=/u/home/j/joelfred/opt' '--enable-shared' '--enable-big-digits' '--enable-ipv6' 'PKG_CONFIG_PATH=/u/home/j/joelfred/opt/lib/pkgconfig:'
Notice I have --enable-shared as a result. If this isn't there, you will need to recompile Python 3. I would recommend using the options that show up here, and adding --enable-shared. Once recompiled, you shouldn't have any problems.

Resources