I am trying to load a dataset into a notebook with. The dataset file file is in the same directory as the Juno notebook. The file name is correct.
I have tried removing the trailing ./ but it didn’t help.
df = pd.read_csv('./datatest.csv')
The error is that it can’t find the file. How can I specify the default directory or get the absolute path of a directory on iOS?
The problem was that both the notebook and the dataset was in a Dropbox folder. I'm not sure why it was the problem as all those files were downloaded locally on the phone and the option 'Make available offline' was set.
When I created a notebook in a local folder on the phone and the dataset was there, the error disappeared.
Related
I started working with Jupyterlab to analyse bunches of CSV files.
It is installed and run within an virtual environment on a windows PC (Windows 10, Python 3.9, JupyterLab 3.5.2).
As the filenames often change and our paths are quite deep I thought a file dialogue would be a good starting point to get data in.
I searched a while and found that ipyfilechooser could be my friend.
So I created a Jupyter Notebook and started with this code block:
import ipywidgets
from ipyfilechooser import FileChooser
chooser = FileChooser(
accept='.csv', # only show CSV files
multiple=False, # allow only one file
# optional starting path
start_path=r'\\sglx-srv1\geschaeft\MESSPLATZ'
)
display(chooser)
After executing this block a chooser widget appeared and I could select a folder or file, also from a UNC path (network drive).
But the setting of the start_path was always ignored and the dialogue always started from the folder the notebook itself is stored in.
I tried any variant I could find to quote the path, but with no luck.
It was not possible to let the file chooser start from any specified path neither local nor UNC.
What is wrong here? Is it a bug in my code or elsewhere?
I can't find the file 'supervisor' in Hue folder. According to official documentation it should be in the folder $HUE_HOME/build/env/bin. I am doing my operation in Ubuntu server 22.04. My objective to send queries to Impala through Hue.
I run following command as it was written in http://cloudera.github.io/hue/latest/administrator/installation/starting/
build/env/bin/supervisor
then I got "No such file or directory" warning.
I also tried
build/env/bin/hue runserver
and I got the same "No such file or directory" warning because there are no such files there.
Those instructions are written relative to Hue's installation folder, or the parent folder of the build-process output. Your error is simply saying that the relative path you're trying to use doesn't exist... Without more context, the error isn't incorrect
For a more simpler installation, you can try running the HUE docker container.
I am using jenkins to run a .bat file that is in location
C:\Users\foo\Desktop\xxx.bat
which internally
copies from another machine an excel
calls a vbs script found in D:
D:\foo\Newtask.vbs
that opens a file:
C:\Users\foo\Desktop\xxx\xxx\xxx\New.xlsm
The error I am getting is
For the first excel: The system cannot find the path specified
For the second New.xlsm:
D:\foo\Newtask.vbs(14, 1) Microsoft Excel: Microsoft Excel cannot access the file 'C:\Users\foo\Desktop\xxx\xxx\xxx\New.xlsm'. There are several possible reasons:
The file name or path does not exist.
The file is being used by another program.
The workbook you are trying to save has the same name as a currently open workbook
I find it odd that jenkins can access and run .bat in foo user's directory while it cannot find C:\Users\foo\Desktop\xxx\xxx\xxx\New.xlsm --> I checked it exists.
When running the .bat manually i have no problem.
Any ideas?
I had the same issue. Solution from this page worked https://techcommunity.microsoft.com/t5/sql-server-support-blog/error-8216-microsoft-office-excel-cannot-access-the-file-8217/ba-p/317477
...x64: Create the following directory:
C:\Windows\SysWOW64\config\systemprofile\Desktop
x86: Create the following directory:
C:\Windows\System32\config\systemprofile\Desktop...
I have an unusual situation. I have a perfectly functional kivy app. Essentially, it uses FileChooserIconView and takes the root
`FileChooserIconView:
filters: [root.selected]
size_hint: (1, 0.4)`
so that with this function
`def selected(self, directory, filename):
# This function extracts the selected folder using
#the information from FileChooser
# This function takes as input:
# -filename: The filename of each file in each directory
# This function gives the output:
# -the full path to the directory with the selected folder
self.ids.mypath.text = os.path.join(os.path.dirname(filename), '') `
I can extract the directory of interest (rather than every single file in the directory).
The app extracts the directory of interest with FileChooser and uses it to extract all files there recursively and process them.
It works perfectly in Spyder in Windows. I package it in Windows and it works perfectly as an independent exe (finds all files that it needs for uploading and works perfectly).
It works perfectly in Spyder in Mac. However, I package it in Mac and it is completely unable to find the local files. This is my problem. Once packaged in mac, instead of looking for the local files in the dist folder, it looks for them in the mac home directory. It requires to read a file that is actually in the dist folder, but the app does not look for it there. It looks for it in the mac home directory.
I have tried to put the current directory where the main.py is (in the dist folder) using several methods, including
filename = inspect.getframeinfo(inspect.currentframe()).filename
path = os.path.dirname(os.path.abspath(filename))
from the question
How to properly determine current script directory?
but still it looks to the mac home directory instead of the directory where the main.py is.
I tried to change directory using the path above, but still goes to the mac home directory.
When I use print(os.getcwd()) in the main.py file it prints the correct directory when used in Spyder, but it goes to the mac home directory after packaging. I am really stuck and I could not find a similar question.
Any help much appreciated.
Thank you very much for all the comments, especially John Anderson who put me in the right track. They made my search much easier.
Finally, I solved it.
When you package an app you should reference the location of the main.py. I was using __file__ and, when the app is not packaged, that works and that is why it worked in Spyder. However, when the app is packaged, the correct way to find the main.py folder is sys._MEIPASS
That it is, as simple as using sys._MEIPASS
For more detail, the link https://pyinstaller.readthedocs.io/en/stable/runtime-information.html#using-file-and-sys-meipass provided by John Anderson is great.
I am trying installing Delphi 5 on my computer. As soon as the installation starts I get:
Error copying File
followed by:
Setup has detected a -113 error while attempting to copy files. This
indicates that setup could not find a file in the "RunImage" directory.
Now the setup file does includes "RunImage" directory. The File is located in the D drive on another computer which I have mapped to my computer as Drive Z and I am running it from the Mapped Drive Z.
I searched online for this Error. Some recommend that if I am installing from a network location then the location has to mapped to my computer as a Driver with a name to solve the issue. I did map the location but still getting the same error.
As J.. already suggested in his comment: Windows >= Vista automatically runs programs containing the string "setup" in the name in elevated mode. In that mode, you don't have the same mapped drives as in your normal user mode. So, the program starts (which is actually inconsistent with security model, because in elevated mode, the executable itself should not be available) and then cannot find any additional files because the drive mapping does not exist.
Solution: Copy the whole installation directory to a local drive. You can delete it after the installation has finished.
Note: While I think this will solve that particular problem, it does not mean, that the rest of the installation will work.
i had same problem and i solved it by this method:
After unpacking the archive(the delphi5 zip file that you downloaded), make the root directory with the command Subst X: "path to installer". Run the standard Borland installer, the Install.exe program, there.