I'm trying to run the LaTexTools plugin in Sublime Text 2.0.2, build 2221. I'm running a 64-bit, Windows 8.1 computer.
LaTexTools is installed and working - it produces a compiled PDF, which is viewable in SumtraPDF and Adobe Reader if I open it manually from the windows folder location. However after building the Tex file, the PDF does not automatically launch. When I try to shift the view to the PDF, Sublime Text throws the following error:
Cannot launch Viewer. Make sure it is on you PATH.
Doing a normal build on the .tex file produces the following output:
[Compiling C:\Users\Mpaull15\Dropbox\Stanford\Project
Planning\research_report.tex]
TraditionalBuilder: Invoking texify... done.
No errors.
[Done!]
And the console shows the following:
<module 'traditionalBuilder' from 'C:\Users\Mpaull15\AppData\Roaming\Sublime Text 2\Packages\LaTeXTools\builders\traditionalBuilder.pyc'>
<class 'traditionalBuilder.TraditionalBuilder'>
Welcome to thread Thread-4
2
['texify', '-b', '-p', '--tex-option="--synctex=1"', u'research_report.tex']
Finished normally
0
False True True
!TEX root = u'C:\\Users\\Mpaull15\\Dropbox\\Stanford\\Project Planning\\research_report.tex'
Jump to: 5 0
Windows, Calling Sumatra
Traceback (most recent call last):
File ".\sublime_plugin.py", line 356, in run_
File ".\jumpToPDF.py", line 109, in run
File ".\subprocess.py", line 633, in __init__
File ".\subprocess.py", line 842, in _execute_child
WindowsError: [Error 2] The system cannot find the file specified
SumatraPDF is installed, is set as my default viewer, and is in my path as the following:
"C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe"
The .tex file I am compiling is in my Dropbox folder if that could be relevant, although I tried moving the entire folder to my Desktop and building there, resulting in the exact same error.
I've looked through StackExchange and past entries on the Sublime Text forums about this issue, and all either seem to result from SumtraPDF not being in the path, or to relate to a different program being called from Sublime Text, with solutions not obviously relevant to the LaTexTools/SumtraPDF interaction here.
Any advice or help would be appreciated!
Your path should only refer to the folder, not the exact .exe.
"C:\Program Files (x86)\SumatraPDF"
Related
I am navigating a web page with firefox using RSelenium package. When i start building my script i used makeFirefoxProfile function to create temporary profile for setting download directory and related file type to download needed file into specific directory.
When i was trying to do that i got an error about zip files. After some research I installed rtools and succesfully managed this error. My script worked as I expected.
Now i want to that operation periodically on Windows Machine. To do that When I try to use taskscheduleR packgage to create task for Windows Task Scheduler i got the some zip error due to windows doesnt have built in comman-line zip tool
You can check the error code below, after i tried to operate the task
Error in file(tmpfile, "rb") : cannot open the connection
Calls: makeFirefoxProfile -> file
In addition: Warning messages:
1: In system2(zip, args, input = input, invisible = TRUE) :
'"zip"' not found
2: In file(tmpfile, "rb") :
cannot open file 'C:\Users\user\AppData\Local\Temp\RtmpKCFo30\file1ee834ae3394.zip': No such file or directory
Execution halted
Within R-Studio when i run my script there is no problem. Thank you for your help
I am trying to use worhp in casadi but I receive the following error message:
Error (License): Could not open license file.
* Local MACs:
- 48:2a:e3:58:b0:47
- 00:ff:76:44:3b:be
- 94:e6:f7:51:bb:f3
- 96:e6:f7:51:bb:f2
- 94:e6:f7:51:bb:f2
- 94:e6:f7:51:bb:f6
WorhpInit: Could not obtain license.
Unsuccessful termination: License error.
Traceback (most recent call last):
File "C:\Users\Marco\Anaconda3\envs\casadi37\lib\site-packages\IPython\core\interactiveshell.py", line 3319, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-2-c949571b9b16>", line 1, in <module>
runfile('G:/Il mio Drive/Lavoro_GoogleDriveUnipi/Repos/MaikGitLab/master_thesis/nmpc_problem.py', wdir='G:/Il mio Drive/Lavoro_GoogleDriveUnipi/Repos/MaikGitLab/master_thesis')
File "C:\Program Files\JetBrains\PyCharm 2019.2.4\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "C:\Program Files\JetBrains\PyCharm 2019.2.4\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "G:/Il mio Drive/Lavoro_GoogleDriveUnipi/Repos/MaikGitLab/master_thesis/nmpc_problem.py", line 488, in <module>
mpc_instance.solve()
File "G:/Il mio Drive/Lavoro_GoogleDriveUnipi/Repos/MaikGitLab/master_thesis/nmpc_problem.py", line 331, in solve
lbg=self.g_lower_bound, ubg=self.g_upper_bound)
File "C:\casadiPackages\casadi-windows-py37-v3.5.1-64bit\casadi\casadi.py", line 13343, in __call__
return self.call(kwargs)
File "C:\casadiPackages\casadi-windows-py37-v3.5.1-64bit\casadi\casadi.py", line 12214, in call
return _casadi.Function_call(self, *args)
RuntimeError: .../casadi/interfaces/worhp/worhp_interface.cpp:307: Main: Initialisation failed. Status: LicenseError
The code should be right since it runs smoothly on a Linux installation of a collaborator of mine.
I am using casadi 3.5.1 (just downloaded) under win10.
I obtained the license file for worhp (I am using version worhp_1.13-2_win64) for the MAC address which is returned by the getmac.exe (the application distributed with worhp to select the correct MAC address which turns out to be the first address returned 48:2a:e3:58:b0:47). The file is located in C:\WORHP/worhp.lic.
I also redundantly added the same worhp.lic in the bin subfolder of the worhp folders located in my local directories and also in the folder where my main.py is sitting.
It seems I have the environment variables set properly, e.g.
in PATH I have the three paths to bin, include, finclude and lib
I have a WORHP_LICENSE_FILE set to C:\WORHP\worhp and a WORHP_DISABLE_WONGLE set to True.
Do you have any hints of what I could be doing wrong?
WORHP is unable to find your license file. If it is located in C:\WORHP\worhp.lic as you say, you should also set the environment variable WORHP_LICENSE_FILE to C:\WORHP\worhp.lic (in your post, the file extension .lic seems to be missing).
Placing the worhp.lic file in the bin subfolder of the WORHP folders as you describe can also allow WORHP to find it, but only if that is the "current working directory" that WORHP is run from. As you say you are using WORHP in CasADi, I assume that that is not the case. You would have to put it in the working directory from which you run CasADi instead.
I've already got Gem5 installed.
I'm trying to do a full system simulation.
I added M5_PATH
echo "export M5_PATH==/home/sam/security/gem5/full/" >> ~/.bashrc
I put all the system image and config files under following directory:
:~/security/gem5/full$ ls
binaries configs config-x86.tar.bz2 disks x86-system.tar.bz2 x86-system.tar.bz2.1
I changed the path in the SysPaths.py file to following:
paths = [ '/dist/m5/system', 'full' ]
And updated the following line in Benchmark.py
return env.get('LINUX_IMAGE', disk('linux-x86.img'))
Gem5 is compiled successfully and I'm running the following:
./build/X86/gem5.opt configs/example/fs.py --disk-image=/home/sam/security/gem5/full/disks/linux-x86.img
But I get an error that it can't find a path to system files.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "build/X86/python/m5/main.py", line 438, in main
exec(filecode, scope)
File "configs/example/fs.py", line 335, in <module>
test_sys = build_test_system(np)
File "configs/example/fs.py", line 93, in build_test_system
cmdline=cmdline)
File "/home/sam/security/gem5/configs/common/FSConfig.py", line 614, in makeLinuxX86System
makeX86System(mem_mode, numCPUs, mdesc, self, Ruby)
File "/home/sam/security/gem5/configs/common/FSConfig.py", line 539, in makeX86System
disk0.childImage(mdesc.disk())
File "/home/sam/security/gem5/configs/common/Benchmarks.py", line 59, in disk
return disk(self.diskname)
File "/home/sam/security/gem5/configs/common/SysPaths.py", line 63, in __call__
raise IOError("Can't find a path to system files.")
IOError: Can't find a path to system files.
Update 2020-01
As of 82f6d6e90f36e400db1f38eef5fe17430313458e reviewed at https://gem5-review.googlesource.com/c/public/gem5/+/23672/7 the CLI insanity has reduced substantially:
M5_PATH is not required anymore on X86 if you point to all required files explicitly:
fs.py --kernel path/to/vmlinux --disk-image path/to/rootfs.ext2
The second disk named linux-bigswap2.img and x86_64-vmlinux-2.6.22.9 are not needed anymore, and you can pass multiple disks at will with multiple --disk-image options, see: How to attach multiple disk images in a simulation with gem5 fs.py?
on ARM, M5_PATH can also be dispensed, but you also need to point the bootloader with:
fs.py --bootloader ./system/arm/bootloader/arm64/boot.arm64
If you miss any of those files, M5_PATH gets used.
Note that just like the PATH search algorithm, paths without / are only searched under M5_PATH, so if you want to point to a file in the current directory you need to add ./ as in:
fs.py --kernel ./vmlinux
see also: Why do you need ./ (dot-slash) before executable or script name to run it in bash?
Old answer
gem5 is picky about some path names, but you don't need to patch it to achieve a decent image setup.
For example, this working setup with gem5 e2656006df442a995bf80ee03fa9700d6ec14537 essentially runs:
M5_PATH=/full/path/to/system \
build/X86/gem5.opt \
configs/example/fs.py \
--disk-image /any/path/to/rootfs.ext2 \
--kernel /any/path/to/vmlinux
and /full/path/to/system contains:
./disks/linux-bigswap2.img
./binaries/x86_64-vmlinux-2.6.22.9
Both of those files are dummies which I generated from here with:
dd if=/dev/zero of=./binaries/linux-bigswap2.img count=1 bs=16k
touch disks/x86_64-vmlinux-2.6.22.9
Yes, this is a horrible workaround to gem5's opinionated image searching... someone should really patch gem5 to not look for those images if you pass --disk-image and --kernel yourself...
As always, have a try at debugging it with prints and PDB: it should then be simple to figure out why something didn't work for you.
I've made an app with PyQt5 and it works perfectly fine on my environment, and now I wan't to deploy it to .exe and .dmg with pyinstaller.
My app uses two local files certificate.yml and data.pkl which each contains certificate data for AWS and data. These are located in the same directory with main.py, which starts my app.
In my main.spec file I've added following
a.datas += [('certificate.yml', 'certificate.yml', 'DATA'),
('data.pkl', 'data.pkl', 'DATA')]
and made .app. However, when I start my .app, it does not find certificate.yml file and raise following error.
FileNotFoundError: [Errno 2] No such file or directory: 'certificate.yml'
How can I include my local files with pyinstaller?
I have a Windows 10 x64 based PC. I am trying to get this PDF-DIFF Python tool here: https://github.com/JoshData/pdf-diff
to run and it hits this error when it is running a line from Python Lib file called 'subprocess.py' file.
I posted this issue with full screenshots of the error and still waiting for response:
https://github.com/JoshData/pdf-diff/issues/30
Just to note that before installation of this github tool I :
1) installed Python 3.6 (tried both 32 bit and 64) and currently have 32 bit
2) installed Microsoft Visual Studio 14.0 Build tools (C++ build tools)
3) in command prompt ran command: pip install lxml so that I could have
the xml libraries downloaded and satisfy the tool's requirements
4) additionally have checked other stackoverflow threads suggesting that 'file not found' error is due to 'COMSPEC' variable being set differently in regedit vs. Python's subprocess.py.
In windows key registry, 'ComSpec' key set to: %SystemRoot%\system32\cmd.exe;
In python subprocess call is being made as such (last line is 997):
if shell:
startupinfo.dwFlags |= _winapi.STARTF_USESHOWWINDOW
startupinfo.wShowWindow = _winapi.SW_HIDE
comspec = os.environ.get("COMSPEC", "cmd.exe")
args = '{} /c "{}"'.format (comspec, args)
#Start the process
try:
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
# no special security
None, None,
int(not close_fds),
creationflags,
env,
os.fspath(cwd) if cwd is not None else
None,
startupinfo)
I'm out of ideas, and feel the program requirements are satisfied.
So, when I run the command in the prompt to get my two PDF files compared and output comparison spit out:
C:\Python36\Scripts\pdf_diff>pdf-diff 683000.pdf 17368000.pdf > comparison_output.png
*I immediately get error shown below:
Traceback (most recent call last):
File "C:\Python36\Scripts\pdf_diff\pdf-diff-script.py", line 11, in
load_entry_point('pdf-diff==0.9.0', 'console_scripts', 'pdf-diff')()
File "C:\Python36\lib\site-packages\pdf_diff-0.9.0-py3.6.egg\pdf_diff\command_line.py", line 496, in main
changes = compute_changes(args.files[0], args.files[1], top_margin=float(args.top_margin), bottom_margin=float(args.bottom_margin))
File "C:\Python36\lib\site-packages\pdf_diff-0.9.0-py3.6.egg\pdf_diff\command_line.py", line 14, in compute_changes
docs = [serialize_pdf(0, pdf_fn_1, top_margin, bottom_margin), serialize_pdf(1, pdf_fn_2, top_margin, bottom_margin)]
File "C:\Python36\lib\site-packages\pdf_diff-0.9.0-py3.6.egg\pdf_diff\command_line.py", line 29, in serialize_pdf
for run in box_generator:
File "C:\Python36\lib\site-packages\pdf_diff-0.9.0-py3.6.egg\pdf_diff\command_line.py", line 102, in mark_eol_hyphens
for next_box in boxes:
File "C:\Python36\lib\site-packages\pdf_diff-0.9.0-py3.6.egg\pdf_diff\command_line.py", line 64, in pdf_to_bboxes
xml = subprocess.check_output(["pdftotext", "-bbox", fn, "/dev/stdout"])
File "C:\Python36\lib\subprocess.py", line 336, in check_output
**kwargs).stdout
File "C:\Python36\lib\subprocess.py", line 403, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Python36\lib\subprocess.py", line 709, in init
restore_signals, start_new_session)
File "C:\Python36\lib\subprocess.py", line 997, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
I believe I found out the problem here. In the process of installing different versions of Python, namely 2.7 and 3.6 I broke something. I believe it could be the importing of different modules for the PDF-diff program. The PDF-DIFF program, according to manual is coded for Python 3. So, I believe the issue above was a versioning issue. I have for now removed Python 3.6 from my machine as I need 2.7 for other projects.